BACKUP AND RESTORE DOTFILES USING GIT
Introduction
This article is about how to back up dotfiles using Git. I will try to keep it short and straightforward.
I’m using Zsh as the shell in the examples, but another shell can be used. The commands below should be executed as a
normal user in the /home directory.
Set up the repository
Create a local Git repository that will be used to track the dotfiles.
git init $HOME/.dotfilesPrepare the environment
The default behaviour of Git commands is to run inside the project folder using information stored at the
<project>/.git directory and Git assumes that the working tree is located at <project>. To enable the execution of
Git commands specifically for the “dotfiles” repository from anywhere, it is needed to create an alias that indicates
the location of the Git directory and the working tree.






