git init --bare $HOME/.dotfiles
- Create a bare Git repository, which is an empty Git repository without a working directory.
alias dot='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
- Create an alias for
git
e.g.dot
to configure the .dotfiles repository.
dotfiles config --local status.showUntrackedFiles no
- Configure Git to not show local files that are not being tracked when using commands like
git status
.
echo "alias dotfiles='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'" >> $HOME/.bashrc
(Optional)
- Add
git
alias to~/.bashrc
.
git clone --bare <git-repository-url> $HOME/.dotfiles
alias dot='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
dot checkout
dot config --local status.showUntrackedFiles no
dot status
dot add .vimrc
ordot add ./config/nvim/init.vim
dot add .bashrc
dot commit -m "Add dotfiles"
dot push