Tag: git merge

How can I preview a merge in git?

I have a git branch (the mainline, for example) and I want to merge in another development branch. Or do I? In order to decide whether I really want to merge this branch in, i’d like to see some sort of preview of what the merge will do. Preferably with the ability to see the […]

Resolve Git merge conflicts in favor of their changes during a pull

How do I resolve a git merge conflict in favor of pulled changes? Basically I need to remove all conflicting changes from a working tree without having to go through all of the conflicts with a git mergetool while keeping all conflict-free changes. Preferably doing this while pulling, not afterwards.

Tell git not to merge binary files but to choose

When the binary files, swfs, jars and flvs are changed locally, and I try to pull in changes, git tries to merge them and reports conflict. And then, I branch to a temporary branch, and commit the local changed binary files, and merge them back after the pull with recursive theirs strategy. — Too much […]

GIT: How can I prevent foxtrot merges in my 'master' branch?

A foxtrot merge is a merge where ‘origin/master’ merges in as a 2nd (or later) parent, like so: Commit ‘D’ is a foxtrot merge because ‘origin/master’ is its 2nd parent. Notice how first-parent history from ‘origin/master’ contains commit ‘B’ at this moment. But in my git repo I need all merges involving ‘origin/master’ to keep […]

tell git to use ours merge strategy on specific files

I have the following directory structure: /.git /.git/info/attributes /MyProject /MyProject/pom.xml /MyProject/MyCode.java I have branch master and bugfix. On both branches pom.xml and MyCode.java were modified. i would like to merge changes from bugfix to master only for MyCode.java and keep master version of pom.xml file. So I added “/.git/info/attributes” because i don’t want to commit […]

Which version of the git file will be finally used: LOCAL, BASE or REMOTE?

When there’s a collison during git merge, I open a mergetool called Meld. It opens three files LOCAL, BASE and REMOTE. As I’ve read LOCAL is my local branch, BASE is common ancestor and REMOTE is the branch to be merged. Now to my question: which version of the file will be finally used? Is […]

Merging without whitespace conflicts

I’ve got a problem where I’ve got a large commit which changes about a thousand lines of code, removing whitespace from the end of lines and removing spaces before tabs. There are also about 50 pull requests for this project, which will all have conflicts when my commit is merged. Is there any way that […]

Best (and safest) way to merge a git branch into master

A new branch from master is created, we call it test. There are several developers who either commit to master or create other branches and later merge into master. Let’s say work on test is taking several days and you want to continuously keep test updated with commits inside master. I would do git pull […]

What's the simplest way to get a list of conflicted files?

I just need a plain list of conflicted files. Is there anything simpler than: git ls-files -u | cut -f 2 | sort -u or git ls-files -u | awk ‘{print $4}’ | sort | uniq ? I guess I could set up a handy alias for that, however was wondering how pros do it. […]

how can I customize git's merge commit message?

Every time I do a merge I need for a merge commit to be generated and I would like it to have more than just the summary of all the commits. My question is how can I format git-fmt-merge-msg or what determines this automated message (I can do this manually after a commit by amending […]

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