https://www.atlassian.com/git/
For those of you new to git or just looking for a refresher, the link above is awesome. There are even a few places which relate git commands to their SVN equivalents.
Beyond that, here are some of my tips:
-
Force yourself to use git from the terminal. Sourcetree is great for getting up and running quickly, but you'll have a much easier time you understand what the commands do. Eventually the GUI just gets in your way.
-
Sync with the upstream/parent branch regularly. This will let you deal with conflicts as they happen, instead of having to fix everything at the end.
-
If you don't feel confident in your git skills, do this sync via merge (
git pull
) instead of rebase (git pull --rebase
). If you are confident,branch.autosetuprebase=always
is nice. -
If you end up with merge conflicts, try to use a merge tool (
git mergetool
) instead of fixing it completely by hand. vimdiff, kdiff3, meld; I'm not sure if Sourcetree has something decent builtin. (Note:local
: current branch you're in;remote
: branch you're pulling from;base
: the shared parent of both branches) -
Use SSH keys. It will make your life easier.
-
Look into GitHub's hub. It's nice being able to just
git clone projectchrono/chrono
vsgit clone git@github.com:projectchrono/chrono.git
.
My config is at: https://github.com/andrewseidl/dotfiles/blob/master/home/.gitconfig