The idea is to make an alias that runs git so that it treats your home directory as a git repository and you can directly commit them.
I would recommend bypassing that article's `config config --local status.showUntrackedFiles no` setting and setting a `~/.gitignore`. This way, git will never tinker with your home directory if you accidentally run the wrong command.
So the complete list of setup commands is:
# Only needs to be done the first time
cat >~/.gitignore<<'EOF'
*
!/.bashrc
!/.zshrc
EOF
# On subsequent runs
git clone --bare ssh://git/cfg.git "${HOME}/.cfg"
function config() {
git --git-dir="${HOME}/.cfg/" --work-tree="${HOME}" "${@}"
}
config checkout -- ~/.gitignore
config reset ~
config checkout -- ~
config submodule update --init --recursive --remote
One caveat is adding files in subdirectories (`~/. config/...`), but just requires changes in your gitignore
The idea is to make an alias that runs git so that it treats your home directory as a git repository and you can directly commit them.
I would recommend bypassing that article's `config config --local status.showUntrackedFiles no` setting and setting a `~/.gitignore`. This way, git will never tinker with your home directory if you accidentally run the wrong command.
So the complete list of setup commands is:
One caveat is adding files in subdirectories (`~/. config/...`), but just requires changes in your gitignore