1

I would like to keep my .bashrc file in a gitlab repo, for obvious reasons. However, it sits in my home directory. Initialising a git repo in my home repo seems unweildly, as it then looks at everything "below" it in the tree (to my understanding).

While I understand that I can simply not add these files to git tracking, I don't want to accidentaly "git add *" out of habit and then try and push my whole directory tree to gitlab's servers.

Is there a way to point my .bashrc (and .vimrc, etc) at a subdirectory or somesuch?

Thanks!

jsarbour
  • 121
  • 3
  • I keep many of my local files in a small local git repo and then link to them. So that ~/ ln -sf /.bashrc. I can then add changes and revert changes to .bashrc and maintain the history through the repo. That might work for you. – – Stephen Boston Apr 29 '19 at 01:15
  • Add a `.gitignore` file in home folder and make it a bit repo with `git init`. – Biswapriyo Apr 29 '19 at 03:42
  • See also [Are there pitfalls to putting $HOME in git instead of symlinking dotfiles?](https://unix.stackexchange.com/q/46538/86440) for some relevant discussion. – Stephen Kitt Apr 29 '19 at 04:20

0 Answers0