Tag: git merge

Revert commits unique to a branch

I have just finished fixing an extremely long merge conflict and then realised I merged to the wrong branch! I merged to dev-majorversion when I meant to merge to dev-majorversion.minorversion. Is there any way I can undo the commits that exist on majorversion but do not exist on minorversion for branch to undo these commits, […]

Fix the way a merge was done in Git

Here is the situation I’m facing: a development branch was merged in the master. The work done in the branch was great, but the resolution of the conflict was very bad (used –ours) -x–x–x–M–z–z / -a–a–a What is in the x and the a is fine, but the problem comes from M. So, ideally, I […]

Git Merge Conflict Custom Auto-Resolution

Is there any way to write a custom merge conflict resolver in git? We are having evil merge conflicts resulting from changing java import statements on multiple branches. These seem like they would be fairly easy to write a plugin to handle automatically 90% of the time. Does git have hooks that would allow us […]

Merging master into develop branch – making sure it works

I always have been doing everything on master, but I also have a develop branch here on which last commit was back in 2014. I want to make those branches the same in source tree, which means merging master into develop branch. I did it, and right now I have something like this: http://oi61.tinypic.com/2who6du.jpg Is […]

git: how to deal with to early branching

I did something like: y1-y2-y3-y4-y5 / / x1-x2-x3 / \ / z1-z2-z3 But now I want to have changes from y1 and y2 also in z2 and the the next ones. z3 was already merged into y5. What we want to achieve is something like: y1-y2-y3-y4-…- throw away / \ x1-x2-x3 \ \ \ z1-z2-z3-z4- […]

Syncing 2 branches after git merge

How do I keep 2 Git branches in sync? I currently have a master branch and a gh-pages branch as well as the respective remotes. Both, master and gh-pages branch shared the same commit id whenever I committed as follows: git checkout master git commit -am “message” git checkout gh-pages git merge master My log […]

Significance of 1 and 2 while reverting merge commit

I came across a situation, where I need to revert one of my merge commit in git. I used the following command: git revert -m 1 [merge commit id] Now git provides one more option for the above command as below: git revert -m 2 [merge commit id] I did not get the difference between […]

How can one make git first parent consistent without rebasing?

I’m looking for a way to use topic branches to create detailed history (and in progress backup) of feature development and use merge commits onto master as summary descriptions of the feature additions. Well OK use –no-ff on your merges in both directions and that’s what you get, right. The problem arises when you try […]

Git merge conflict when trying to pull from subtree

After doing a git pull I’m getting a bunch of conflicts across ~100 files. I want the recently pulled changes to overwrite my own code. I found this answer which seems similar to what I’m trying to do. But when I use: git merge -s recursive -X theirs It results in: Merging is not possible […]

What causes git to rewrite a commit rather than reusing the existing one?

I’ve implemented a workflow to manage configuration files as follows: production is functionally equivalent to what is on the live production server, as the server performs a checkout of production routinely after verifying nothing has changed locally. pre-production is functionally equivalent to what is on the live pre-production server (see production). development is effectively equivalent […]

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