Tag: merge

git merge -s recursive -X ours vs git merge -s ours?

In man git–merge doc, git merge -s recursive -X ours: This should not be confused with the ours merge strategy, which does not even look at what the other tree contains at all. It discards everything the other tree did, declaring our history contains all that happened in it. I have tested these two but […]

GIT: How to pull changes from branch after a reverted merge

I hope the title is not very confusing. History (aka What I did wrong): Let’s say there are two branches, master and feature. Feature is a branch where I keep a longer feature project and from time to time I use git pull origin master on that branch to stay updated with changes in main […]

Removing features from releases in Git Flow

I work on a team with a large Java code base (300k+ lines of code), which recently adopted Git as the source control (migrated from ClearCase). We are using Git Flow as our branching strategy. There are a couple of use cases that we come across fairly frequently which we have been struggling with. We […]

git merge ignores deleted files, existing on merged branch (renamed files)

I’ve got the branches feature1 and master. Then in feature1 I renamed a file dir/file.txt into dir2/file2.txt. After that I altered the file in master and a week later altered the file in feature1 too. I have 40 files changed like that across the project. When I try to merge master into feature1 I’m using […]

git get conflicts from past merge without running merge once again

I’ve merged two branches. Got lot’s of conflicts. Resolved them all. Now I’m not sure, maybe I’ve made an error during conflict resolution. And I don’t see no another way to check is it true — just run merge again, and check conflicts one by one. This means I need to create one more branch […]

See what would be merged in one git command?

Currently, before merging a branch, I use the following commands to see what changes will be merged: base=$(git merge-base other HEAD) git diff $base other Is there a single git command to achieve this? Regards, Jochen

Git: How to merge a small, but very old branch?

We’re migrating from SVN, and also merging a bunch of branches. To massively simplify, we have a branch B which was forked a long time ago, and has a little bit of development, let’s say 8 files modified, out of hundreds. Meanwhile, huge changes have happened on master: A | X—(a few changes)— B | […]

Git: merge conflict and commit message

I merge with Git and get a conflict. After having resolved the conflicts, upon commit I will see an auto-generated commit message containing a list of files which were in conflict. What is the best-practice – should I keep this list of conflicting files for a good reason or can I delete this part of […]

“unpack failed: error Missing commit” but commit exists

After long hours of searching for this specific problem, i didn’t find another solution but post a question here: Scenario: Two remote servers: git.address-a.com and git.address-b.com One local repository with two remotes: origin to git.address-a.com and remote-b to git.address-b.com Every day, i check if something was pushed to remote-b. If anything was pushed, i create […]

Find first common child of two commits

: A T / \ i B C m : : e D E \ / | F V : git merge-base B E allows to find where a the common ancestor A of the two commits. Is there a way to find the commit F where the two branches are merged again?

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