Tag: merge

Fixing Git repo after incorrect merging

I had a bunch of separate branches, and I wanted to merge them, as each of them was an update to a different part of the program. I guess I was supposed to merge them but instead I ran a git commit -a after cheking out each branch. Then I realized the whole program went […]

Custom Git merge driver with no rename detection

I would like to set up a Git repository with a custom merge driver, and then disable rename detection when merging. The problem is that, if I use the default recursive strategy, I cannot disable rename detection, and if I use the resolve strategy (not ideal, but good enough), the merge driver is ignored. Note […]

Git fast forward merge: Any chance to find the person to blame?

Suppose there is a feature branch ‘my-feature’. While I was developing the feature, somebody merged it from ‘my-feature’ into ‘master’. Because it was a fast-forward merge, no commit was made. Some of the changes made by me weren’t ready for master yet, and it broke quite a few tests when it was pushed to master. […]

Git fetch/checkout without creating remote?

How to fetch/checkout remote repository without creating locally remote branch? Use Case: I have some repo on GitHub, someone forked it and added new feature and initiated pull request. I can’t automatically merge it because there are some minor problems I would like to fix first. It’s one-time activity I’ll never need this remote repository, […]

stop git merge from opening text editor

Every time i run a git merge command it opens the text editor asking me to add an extra message. How can I stop git from opening the editor & simply merging my branches? Because when it opens the editor it doesn’t complete the merge, even if I add an extra message & save the […]

How can I combine two commits into one commit?

I have a branch ‘firstproject’ with 2 commits. I want to get rid of these commits and make them appear as a single commit. The command git merge –squash sounds promising, but when I run git merge –squash my terminal just brings up options for the command. What is the correct command? Commit 1: Added […]

How to commit a long Git merge in the middle of resolving conflicts

I have a big merge going on with over 300 conflicting files. I want to resolve these using mergetool, but there’s no way I’m going to finish it all in one sitting. How can I commit the merge and then come back later and continue the same merge? Normally it seems git doesn’t allow you […]

Integrate indentation & content changes in Git during merge: Best practices?

I’m using Git to track some matlab code. A toy example best illustrates the problem. The project so far looks like this. C / A– \ B Contents of A are x=5 We make commit C, where the line is changed to x=6 We then make commit B, where our content becomes as below if […]

Git: Prevent commits in master branch

(For simplicity) I have a master branch and a dev in my Git-repo. I want to ensure the master branch is always working, so all work I do should be in the dev branch. However, when I merge my changes in with a –no-ff merge, I tend to stay in the master branch, and just […]

What are the underlying git merge processes within the staging area?

Git does the merge magic, and then lets the user resolve real conflicts, which is as it should be. I’m looking for a low level description of the how and why of the basic git merge and how it uses the staging area. I’ve just read the Git Parable, and the comment on here that […]

Git Baby is a git and github fan, let's start git clone.