Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 454 Bytes

File metadata and controls

32 lines (22 loc) · 454 Bytes

How to backup dotfiles

One trick is to use the work-tree option of git.

Add this two line in your .zshrc

DOTFILES_PATH=$HOME/.df
alias dtf="git --git-dir $DOTFILES_PATH --work-tree=$HOME"

Then reload the config.

source ~/.zshrc

Create git-dir

mkdir ~/.df

Now you can start backup your dotfiles.

dtf add .vimrc .tmux.conf .zshrc .spacemacs
dtf status
dtf commit -m "vimrc backuped"
dtf push