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 ~/.zshrcCreate git-dir
mkdir ~/.dfNow you can start backup your dotfiles.
dtf add .vimrc .tmux.conf .zshrc .spacemacs
dtf status
dtf commit -m "vimrc backuped"
dtf push