Awesome Open Source
Awesome Open Source

My config files ...

These are my config files on macOS.

Settings for:

How I am managing the dotfiles

Using a bare Git repo. The dotfiles can reside where they are. No symlinks needed.

Initial setup

Create a bare Git repo to store the history.

git init --bare $HOME/dotfiles

Create an alias in zshrc, tell Git where the history and the working tree (snapshot) live.

alias cfg='git --git-dir=$HOME/dotfiles/ --work-tree=$HOME'

Tell Git not to show all the untracked files (otherwise all files under $HOME will be shown when running git status.

cfg config status.showUntrackedFiles no

Set up the remote repo to sync

cfg remote add origin

Done! Now we can manage our dotfiles.

cfg status
cfg add ~/.config/zsh
cfg commit -m "zsh config"
cfg push origin master

Clone to another machine

Clone this repo onto a new machine as a non-bare repo because we need the actual dotfiles that is the working tree, i.e., the snapshot of the repo.

git clone --separate-git-dir=$HOME/dotfiles dotfiles-temp

Copy the dotfiles to the location where they should reside.

rsync --recursive --verbose --exclude '.git' dotfiles-temp/ $HOME/

Remove the temp directory.

trash dotfiles-temp

Tell Git not to show all the untracked files.

cfg config status.showUntrackedFiles no

Finally, set up your own remote repo for syncing.

cfg remote add origin

Done! Now, start to manage your dotfiles.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Shell (229,298
Config (24,030
Macos (9,195
Dotfiles (6,732
Vim (5,854
Zsh (3,365
Neovim (2,587
Iterm2 (376
Alacritty (244
Kitty (179
Ranger (169
Yabai (44
Vifm (29
Lf (27
Related Projects