Linux dotfiles and other configurations Setup, installation and usage from durdn's blog post.
- Create bare git repository:
git init --bare $HOME/.dotfiles
- Alias git command for bare repository:
alias dotgit='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
- Ignore untracked files by default:
dotgit config --local status.showUntrackedFiles no
- Add
dotgit
to.bashrc
:echo "alias dotgit='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.bashrc; source $HOME/.bashrc
- Create a remote repository on Github
- Add the remote to the local bare repository:
dotgit remote add <remote_name> <repository ssh/url>
- Use the
dotgit
repository as a normal git repository.
- Add the alias to the .bashrc:
echo "alias dotgit='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.bashrc; source $HOME/.bashrc
- Add the
.dotfiles
folder to.gitignore
:echo ".dotfiles" >> .gitignore
- Clone the repository:
git clone --bare <repo ssh/url> $HOME/.dotfiles
- Checkout the repository contents:
dotgit checkout
- If you have conflict, backup the conflicting files to another folder and delete them on the $HOME directory:
mkdir -p .config-backup && \
dotgit checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \
xargs -I{} mv {} .config-backup/{}
- Re-run the checkout command:
dotgit checkout
- Ignore untracked files by default:
dotgit config --local status.showUntrackedFiles no
- Use the bare repository as a normal git repo with the
dotgit
alias
- Bash files included:
.bash_profile
: loaded on login. Sources~.bashrc
.bashrc
: loaded on each new terminal. Main file for configurations.- Sources
/etc/bashrc
, if exists (system-wide bash configurations) - Sources
$HOME/.bash_local
, if exists (local and unsynced configurations)
- Sources
- Initialize submodules:
dotgit submodule update --init --recursive
- Install Vundle Plugins:
vim +PluginInstall +qall
- Check
.vim/README.md
for more details
- Check
.config/nvim/README.md
for more details