happy-git-with-r
happy-git-with-r copied to clipboard
git config worth considering
One general goal is to make it very unlikely that a novice finds self unexpectedly "in the middle of" a merge. Obviously there's no way to universally avoid reconciling conflicts, but it's much nicer to be alerted to the problem and given the chance to decide how to proceed.
Default to allowing only fast forward merges upon pull.
git config --add pull.ff only
It's possible that doing same for merges (merge.ff) is a good idea too?
Re: doing something sensible when you just do git push
, with no branch specified.
Push the current branch to a branch of the same name. And that's it. Don't push other branches.
git config --global push.default current
More notes ...
Git 2.0 (release 2014-05) uses simple
push strategy by default:
- branches are pushed to their upstream branch
- no push if remote branch name != local branch name, unless explicitly specified via
git push origin remotebranchename
Git versions below 2.0 use matching
strategy by default:
-
git push
, no arguments, pushes ALL branches that have same name locally and on remote
Conclusion: simple
is better than matching
.
Re: current
vs simple
, apparently this has to do with upstream tracking branches and branch names, which is yet another issue. If you always name local branch and remote branch the same, you will never notice the difference. I guess technically simple
is safer.
core.autocrlf
on Windows: you almost certainly want this to be true
.