Useful things when working with git

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:

This will always assume you want to push you current branch to origin with the same name (like develop to origin/develop).

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.

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.

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.

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).

Leave a Reply

Name and Email Address are required fields. Your email will not be published or shared with third parties.