All of my Linux config files. Easy installation and maintenance with Git bare repository.
I use Linux distributions daily for both personal and work related things. Over the years I have customized Linux CLI tools to my liking. This repository has my config files for the following programs:
- Zsh with Prezto configuration framework
- Tmux
- Neovim / Vim
Git has a feature called "bare repository". You can place git-dir
(contents of .git) and work-tree
on different
paths. I setup a Bare repository in any folder. When I'm working on dotfiles repo I use an alias which sets --git-dir
to bare repository and --work-tree
to my home directory. So I can access my dotfiles repo from any directory without
the need to cd
first.
-
Fork the repo.
-
Copy HTTPS or SSH clone link of your fork.
-
Prepare dotfiles directory.
-
Initialize bare Git repository.
git init --bare $HOME/.dotfiles
-
Add an alias to
.bashrc
or.zshrc
(if you use Zsh as shell).alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' alias config_edit="(export GIT_DIR=$HOME/.dotfiles; export GIT_WORK_TREE=$HOME; nvim)"
-
Configure local Git settings for the repository.
config config --local status.showUntrackedFiles no config config --local core.worktree $HOME
-
Set your fork as remote repository. I used my repo's HTTPS clone link in this example. You should use the link you copied.
config remote add origin https://github.com/arensonzz/dotfiles.git
-
-
Pull dotfiles from repo
config pull origin master
Use config
alias instead of git
when working with dotfiles repository.
config status
config add ~/.bashrc
config commit -m "Modify bash config"
config add ~/.zshrc
config commit -m "Modify zsh config"
config push origin master
Also you can use the config_edit
alias which opens up Neovim
editor with correct Git env variables set so you can
use tools like vim-fugitive
to stash changes, commit, etc.