4 ms·
The following .gitignore is my favorite way to commit an (almost) empty folder to git: # Ignore everything in this directory * # Except this file !.gi
by anshargal 4y ago
The following .gitignore is my favorite way to commit an (almost) empty folder to git:
# Ignore everything in this directory
*
# Except this file
!.gitignore
.gitignore can be present in any directory and there is a way to unignore a wildcard
- _fat_santa 4y agoI was looking at someone's dotfiles on Github a while back and they employed this method. Essentially they made their entire home directory a git repo but used gitignore to ignore everything but the dotfiles they wanted to backup. It was a pretty nifty setup
- ansible 4y agoI feel obligated to point out vcsh [1], which is likely already packaged for your operating system. [1] https://github.com/RichiH/vcsh https://github.com/RichiH/vcsh The main selling point is that you can set up various git repos for different things. I have one for SSH keys (and no, that does not get pushed anywhere except to my own private server), VIM, neovim, bash, and 'other' (for misc config files like .dir_colors, .gitconfig, etc.).
- account42 4y agoA nifty setup until you run a git command like `git clean -fx` somewhere under your home directory that you think is another git directory but isn't. Happy restore from backups time.
- joboyx 4y agoAnother option is to clone the dotfiles repo to your workspace. Then create symbolic links in your home directory. Like: ln -fs ~/workspace/dotfiles/vimrc ~/.vimrc