git
Last updated
Was this helpful?
Last updated
Was this helpful?
git is everyone's favorite version control system.
Git How To: - learn the basics
The official Git Book: - everything you ever wanted to know about Git
Learn Git Branching: - test your knowledge without having to set up intricate and contrived repositories
Intermediate to advanced tutorial of git and its internals: - learn how does it actually work
Oh shit, git: - "Mom come pick me up I'm scared"
There is nothing that annoys me more than cloning a bunch of .vscode
, .atom
, .idea
and other directories alongside an interesting project. To keep your personal preferences from infiltrating everyone else's systems, you should use a global .gitignore
file, which I like to place in my $HOME
as .gitignore_global
(but if you have a Linux system you should probably put it in your ~/.config
directory).
Run the following command to introduce ~/.gitignore_global
to Git:
git config --global core.excludesfile ~/.gitignore_global
Then you can use the familiar .gitignore syntax to ignore commonly ignored files:
If you share your dotfiles on the World Wide Web, or you just keep them in a git repo as a backup, you should probably not include your name, email and other things in your main git config, just so that others who might want to use it don't accidentally commit as you. Thankfully, Git lets us include configs into one another using the include
directive:
Now you can add .gitconfig.local
to your .gitignore
in your dotfiles repository and publish the rest of the thing, while adding private config to the local one: