git-merge
strategy for git and append-mostly files
You could use the gitattributes mechanism to define a custom merge driver (like this one for instance) in order to copy automatically the relevant sections. [merge “aggregate”] name = agregate both new sections driver = aggregate.sh %O %A %B It will be a 3-way merge, which means you can easily diff %A and %B against … Read more
What is a merge request?
Merge Request and Pull request basically refers to same thing. Tools such as GitHub and Bitbucket choose the name pull request since the first manual action would be to pull the feature branch. Tools such as GitLab and Gitorious choose the name merge request since that is the final action that is requested of the … Read more
Is there a way to specify a default option for merging a pull request in GitHub?
The GitHub user interface will default the option to the last option selected by the user for the current project. This solves the issue of not accidentally using the wrong default, since after the merge is done correctly for the first PR, subsequent merges will have the desired default. This solution isn’t perfect. If a … Read more
Git – diff3 Conflict Style – Temporary merge branch
What you have here (with the Temporary merge branch 1 and same with 2) is due to git’s “recursive merge” method: o->branch1 = “Temporary merge branch 1”; o->branch2 = “Temporary merge branch 2”; merge_recursive(o, merged_common_ancestors, iter->item, NULL, &merged_common_ancestors); (merge-recursive.c, around line 1940). Git will do a recursive merge when the commit graph has multiple candidates … Read more
Why did Git create a merge commit with no file changes?
You can omit creating merge commits, by using rebase instead of merge. As @Dougal said, if you do git fetch, you can execute git rebase afterwards to change the base of your changes to the fetched HEAD. Usually you create those unwanted merge commits, by pulling from remote repository. In that case you can add … Read more
How do I merge a branch into a master in github?
Please do following set of commands in order to merge with the master, Assuming that you are in branch testBranch and you want to merge the changes with the master, First checkout to master branch, git checkout master Now pull the latest changes in master, git pull origin master Merge with the testBranch git merge … Read more
How to configure “git pull –ff-only” and “git merge –no-ff”
That shouldn’t be the case, according to the git-config man page on pull.ff: (…) When set to only, only such fast-forward merges are allowed (equivalent to giving the –ff-only option from the command line). This setting overrides merge.ff when pulling. The configuration pull.ff has been introduced in Git 2.x, so it won’t work as expected … Read more
git: fatal: ‘–ours/–theirs’ cannot be used with switching branches
Using git checkout with –ours or –theirs expects at least one argument: the path(s) of the files / directories to checkout. As the manual says: When checking out paths from the index, check out stage #2 (ours) or #3 (theirs) for unmerged paths. So: git checkout –ours <path(s)>
How to set no “fast forward” as default when using git merge
Set the config variable merge.ff to false: git config –global merge.ff false (Without –global to limit the effect to the current project)