We need to install stow, a symlink farm manager: sudo apt install stow git
First-Time git setup. Set your user name and email address: git config ‐‐global user.name “userName”. git config ‐‐global user.email “myEmail@gmail.com”. Then, check your settings: git config ‐‐list
Go to github. Log in to your account. Click on the New repository button or the + icon, then click on New repository. Next you have to fill out a name of the repository (dotfiles), a description (it is really optional), and select its visibility or access permission (public -Anyone on the internet can see this repository. You choose who can commit- or private -You choose who can see and commit to this repository-).
After that you have your new repository, so you can copy the repository link by clicking on the green Code button. Open a terminal and clone the repository (very easy setup):
git clone https://github.com/nmaximo7/dotfiles.git
Open the directory dotfiles with Visual Studio Code: code dotfiles.
Mirror your home’s structure inside the dotfiles directory, e.g., create a directory git, and a file “.gitconfig” inside git; create a directory bash, and two files “.bash_aliases” and “.bashrc” inside bash.
Manage and sync dotfiles with Git + GNU Stow
Check if stow is going to create the right symlinks or not before creating then: stow ‐‐adopt -nvt ~ * (~ directory home, * the dotfiles directory).
And then create them: stow ‐‐adopt -vt ~ * The flag -n tells stow not to perform any operations that modify the filesystem, but merely show what would happen. -t is the target (~, the home directory).
MV: .config/calcurse/conf -> dotfiles/Calcurse/.config/calcurse/conf LINK: .config/calcurse/conf => ../../dotfiles/Calcurse/.config/calcurse/conf9.
We use the git add . command to add any changes in the working directory to the staging area: git add .
Save changes to the local repository: git commit -am “Initial commit”
Upload the local repository content to our recently created github remote repository: git push.
If you have a new computer, you will start by cloning the remote repository: git clone https://github.com/nmaximo7/dotfiles.git. After that you can update the local repository with: git pull.
Stow the files and directories into the target directory. First, check that it is working as expected: stow ‐‐adopt -nvSt ~ *, then do it: stow ‐‐adopt -vSt ~ *
git clone https://github.com/nmaximo7/dotfiles.git cd dotfiles stow –adopt -nvSt ~ * stow –adopt -vSt ~ *