So you’re working with git and you think it’s the best thing that every happened to you? Same with me, however there are a few settings that make working with git even more fun! Here they are:
1 |
git config --global push.default current |
This will always assume you want to push you current branch to origin with the same name (like develop to origin/develop).
1 |
git config --global branch.autosetupmerge true |
More or less the same thing, just in the other direction. When you pull, git will assume you want to fetch & merge the origin branch with the same name.
1 |
git config --global merge.ff false |
This will disable fast-forward when doing merges. This means, that even if there is no merge needed (because one of the parents is the common ancestor), there will still be a merge commit. This is useful to keep track of the branch history.
1 |
git config --global merge.conflictstyle diff3 |
This will tell git to use style diff3 to solve conflicts. Compared to the default style, this will also add the common ancestor version in the conflicting file, showing not only the result in both branches, but also the state before the changes. This often helps to resolve conflicts easier.
1 |
git config --global rerere.enabled true |
This tells git to remember how you solved a conflict. When a conflict appears, git will check the conflict history database and uses the same solution if the conflict is the same. Very helpful if you have conflicts that appear again and again (like storyboard files or submodules).