Those dotfiles are managed with a bare Git repository.
Where I have copy/pasted many configs :)
The idea is well explained on this vieo and on this post of atlassian.
- On your home directory you need to do:
## Create a folder on $HOME
mkdir .dotfiles
## init git bare repo
git init --bare $HOME/.dotfiles
## create an alias
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
## avoid show untracked files
dotfiles config --local status.showUntrackedFiles no
## add the repo as remote origin
dotfiles remote add origin [email protected]:ggsalas/dotfiles.git
## replace all tracked files with the repo files
dotfiles fetch
dotfiles pull origin master
dotfiles reset --hard origin/master
dotfiles branch --set-upstream-to=origin/master master
dotfiles pull
- Now you can use the
dotfiles
repo as it wasgit
command. Example:
dotfiles add .zshrc
dotfiles commit
dotfiles push
To create a new git bare repo to handle your dotfiles you only need to do this:
git init --bare $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
also add a alias on .zshrc
or .bashrc
:
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
To see the untracked files on a specific folder:
df status -u ~/<folder}