Tag: git merge

Git “leaky” branches?

We usually do feature development on new branches and then bugfixes on the master branch. This time, for some reason, one of the feature branches had a leak where it was merged back into master when it shouldn’t have. From the screenshot, you can see that we have the feature branches sms_open and 121217. 121217 […]

Merge two commits where commits are between

I want to merge two commits – there are commits between these two commits. The commits between don’t change files edited by commit 1 and commit 6. The commits are not pushed yet. Is this possible? f68ffb5 commit 6 … d294fac commit 1

Git: after preparing a real merge commit, how to create a simple commit?

After invoking git merge –no-commit <commit>, performing a commit will result in a merge commit with two (or more) parents. What command to invoke to create a simple commit instead (without having to re-perform the merge command with the –squash option)?

strange output during git merge

I am in a clone named /private/gmills, and I ran git merge main_int. I am seeing a reference to another clone for some other user on a different machine. What does this mean? I have only 1 remote configured and it isn’t pointing to this other clone or machine. Warning message : warning: Failed to […]

How to prevent merge from falling back to normal merge strategy when a fast-forward merge is not possible?

The git merge command has an option to perform fast-forward merge, but this is not what I want, because if it can’t do a fast-forward merge, it uses the normal merge. Is there a git command which only performs a fast-forward merge (from the tracked remote branch) and does nothing if the fast-forward merge is […]

In git, how do I increase the context for merges?

When I merge large changes, git often gets hopelessly confused because it’s not using enough context lines. It gets mixed up between the similar-looking endings of two different subroutines that both happen to end with: . return 1; . } (dots used here to represent blank lines) When I use ‘git diff’, I can say […]

Should I merge master into a feature branch to bring it up to date? Would this be considered bad practice?

I have a situation like this: (master) A – B – E – F \ C – D (feature-x) Should I merge master into feature-x if I need critical fixes E and F into the feature-x branch to continue development and I intend to merge back into master? Is there any disadvantage to repeated merging […]

Merge conflict error, when there was no change in mentioned file

I have a site local repo and a remote repo. Local repo contains the 1-2 month old content of remote repo. I try to pull the whole content into local repo. git pull origin master From ssh://…/site.git * branch master -> FETCH_HEAD … CONFLICT (add/add): Merge conflict in admin/process_email.php Automatic merge failed; fix conflicts and […]

How to set difftool/mergetool for a specific file extension in Git?

Is it possible to set a custom tool for merging files with a specific extension in Git? Thanks for any pointers! Update I wasn’t able to come up with any better solution than defining a custom difftool and calling it by hand as @jarodeells suggested: [diff] tool = mydiff [difftool “mydiff”] cmd=”script.sh \”$LOCAL\” \”$REMOTE\”” Then […]

Undo git fast forward merge

I have this situation : Working on some testBranch for some time and I wanted to sync with master so I did git checkout testBranch and git merge master/testBranch So now my branch is synced with master but then I found out that I want to undo that merge and problem is that merge is […]

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