Tag: git merge

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 […]

Merge, update, and pull Git branches without using checkouts

I work on a project that has 2 branches, A and B. I typically work on branch A, and merge stuff from branch B. For the merging, I would typically do: git merge origin/branchB However, I would also like to keep a local copy of branch B, as I may occasionally check out the branch […]

How to resolve merge conflicts in Git?

Is there a good way to explain how to resolve merge conflicts in Git?

Why does git fast-forward merges by default?

Coming from mercurial, I use branches to organize features. Naturally, I want to see this work-flow in my history as well. I started my new project using git and finished my first feature. When merging the feature, I realized git uses fast-forward, i.e. it applies my changes directly to the master branch if possible and […]

Git workflow and rebase vs merge questions

I’ve been using Git now for a couple of months on a project with one other developer. I have several years of experience with SVN, so I guess I bring a lot of baggage to the relationship. I have heard that Git is excellent for branching and merging, and so far, I just don’t see […]

How do I tell git to always select my local version for conflicted merges on a specific file?

Say I’m collaborating with someone via a git repository, and there is a particular file that I never want to accept any external changes to. Is there any way for me to set up my local repo to not complain about a conflicted merge every time I git pull? I’d like to always select my […]

When would you use the different git merge strategies?

From the man page on git–merge, there are a number of merge strategies you can use. resolve – This can only resolve two heads (i.e. the current branch and another branch you pulled from) using 3-way merge algorithm. It tries to carefully detect criss-cross merge ambiguities and is considered generally safe and fast. recursive – […]

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