Written words that are often helpful

Using Git to files outside the repo

Posted by chathaway on Sept. 1, 2017, 1:29 a.m.

I decided that I wanted to keep a few files in my home directory in version control (.vimrc, .bashrc, .config/awesome), but don't like making that directory a git repo because then the shell prompts always say I'm in a branch. To fix this, I init'd a repo in my normal place then ran:

git config --local --add core.worktree $HOME

And now I can add things like "git add ~/.bashrc" without having to keep that repo in my home directory.


Banner Image © 2017 Ranjani Hathaway | Content © 2017 Charles Hathaway PDF