Questions tagged [git-merge]

git-merge is a git command which integrates changes from another branch by incorporating commits into the currently checked-out branch.

A merge in version control is an operation where two sets of changes are combined to have both features available.

Git provides sophisticated merge support by automatically detecting simple merges (i.e. if only changes on one branch happened, also called fast-forward) and allowing plugable merge-strategies for more advanced use-cases.

3320 questions
1
vote
1 answer

Which git command give me only merge commits for the master branch?

I just merged PR to the master. I want to log all the merges commits. So which git command give me only merge commits for the master branch?
Jack Bury
  • 125
  • 1
  • 1
  • 7
1
vote
2 answers

Git pull vs fetch + merge, what is the point of merging without a fetch first?

A git pull is a git fetch then a git merge. But, specifically, why would one ever git merge without doing a fetch first? i.e. why would it be possible to break one seemingly unitary operation into two sub-operations?
Markus
  • 1,020
  • 14
  • 18
1
vote
0 answers

Is there a way to specify a custom tool to be always used by git when doing a merge?

In one of my projects, I have some files with a specific extension that I would like to merge using a specific tool of my own instead of git itself. I know it is possible to specify custom merge and diff tools in .gitconfig this way : [difftool…
tigrou
  • 4,236
  • 5
  • 33
  • 59
1
vote
1 answer

How do I update a parent branch without deleting the clild one in git?

I know this was answered somewhere but I cannot find the right wording. The question is: If I have a master branch and a master/branch1 branch, and I have commits in it like this: c c | | c c | | |/ c = commit How can I do something like tihis? c…
Leo
  • 13
  • 5
1
vote
1 answer

How to pick all the changes of a git repo fork F1 from same parent with the other fork F2

Say there is a repo (L), for example, llvm. There are thousands of forks on it. Let's say someone forked from the repo L at commit Cx; let's call the forked repo F1. Over a period of time, features were added to F1 and it is still growing and let's…
SantMan
  • 77
  • 6
1
vote
1 answer

How to determine if a merge adds new information

Following situation: Some branch encoder_dev has been merged into a branch encoder. encoder has been merged into integration, integration has been merged into master. All the merges were true merges. The branch encoder_dev has got another…
Andy
  • 634
  • 7
  • 19
1
vote
1 answer

git: how to get/merge old commit from same branch(ie master)?

I am using git using and want to get code from previous commits to the head. I have figured out a way to do this but that seems more like a hack, I am wondering if there is a better way of doing it. The method I used is as follows: I involve going…
Zarak Khan
  • 21
  • 4
1
vote
0 answers

What is the best way to allow user merge only specific branch?

We have several teams which are working on multiple branches, I want to allow them only to merge from master and develop and not from each other, because we had an issue in which someone merge another team's branch and pushed to master (that was a…
maya li
  • 33
  • 3
1
vote
1 answer

Why are changes missing without a trace after a merge?

while working on our code we encountered a problem inside our git repository: On august 15th, the method "CheckforLogout" inside the class "UserHelper" was still present (Commit: 08cc360 or green commit in the picture). After the 26th of august,…
Marc
  • 13
  • 3
1
vote
1 answer

How to resync local master to remote master?

The master branch in my local repo is showing a push badge with increasing numbers. I know it is up-to-date with the remote master, because all changes in local branches have been pulled and merged into the remote master. But every time I fetch…
alfavictor
  • 63
  • 9
1
vote
5 answers

Git merge just overwrites a branch?

I am pretty new to git and I can't get it to merge changes the way I want it to. So here is what I am trying to accomplish: I need to update our learning management system. I have 2 branches I am working on: mergebranch and update. On mergebranch, I…
Sanshi
  • 13
  • 2
1
vote
1 answer

How to remove someone else's code from my commit after I pulled and rebased?

I created a new branch from development branch and started writing code and pushing it to GitHub. But after a while the development branch was updated. So I needed to update the changes and rebase my code. I checked out development and did a git…
1
vote
1 answer

How to merge changes from specific branch into different base branch?

I have a workflow where we have two branches master and develop. I checked out to develop, created new branch feature1 and merged its changes to develop. Now after passing testing I want to merge my changes of ONLY feature1 into master but when I…
1
vote
1 answer

Git manual merge issues

So what I want to do is: There is an old branch foo with some changes that I want in a new branch. Here's what I did: I created a new branch bar based off of the branch foo and wanted to merge changes from the current working branch baz into bar.…
BitFreak
  • 406
  • 3
  • 10
1
vote
1 answer

Git-History of a file, that was modified by git merge -s subtree

How can I get git log to show me the entire history of a file when even git log -M --follow --full-history new/directory/file failed. But first a bit of context on the changes not showing... We imported a git repository inside another one, we…
1 2 3
99
100