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

inspect changes after a git pull merge

is it possible to play a git diff in the changes brought by the automatic merge after a git pull? Usually, if there are any conflicts i can check on those using normal git diff, but no idea how to do it when the pull was successful (and the changes…
lurscher
  • 25,930
  • 29
  • 122
  • 185
1
vote
3 answers

GIT replace branch's contents

I've got a bare repo setup with the following branches: dev *master stage prod I've cloned this to a working copy and issued the following commands: git checkout -b stage remotes/origin/stage git checkout -b dev remotes/origin/dev What I need to…
John Zumbrum
  • 2,786
  • 8
  • 36
  • 60
1
vote
1 answer

Using git, how do a merge a tracked branch back into the remote origin/HEAD?

I got myself into a little bit of a local repo mess. Long story short, I had a copy of a remote repo; I created a branch called 'my_branch' in my local repo; I committed work a few times. I then just pushed the branch to the remote repo. Here's my…
milesmeow
  • 3,688
  • 5
  • 35
  • 58
1
vote
2 answers

merging two git remote repositories locally

I want to make use of this feature -- https://github.com/xetorthio/jedis/pull/160. Although this issue has been closed, it has not been merged with the master. Is it possible to clone the master on my local machine and merge pull request #160 on my…
Raghava
  • 947
  • 4
  • 15
  • 29
1
vote
2 answers

git merge between different repositories

I created a repository with git-svn from a big svn repository (git svn clone). I've several local commits in my git repository that I don't need to push to svn but I will need to get updates from it. Now I realized that I don't need the entire svn…
Andrea Polci
  • 1,011
  • 13
  • 27
1
vote
1 answer

git workflow for merging new branch and how to stop auto-merge?

The setup of my repositories is like this: A web server named LIVE A server acting as central repo with a bare clone from LIVE, named REPO A test web server named TEST with a clone from REPO (aka the same files as LIVE) Egit with eclipse for…
karpa
  • 201
  • 4
  • 17
1
vote
1 answer

Git svn fetch check if no commit left to merge

I have cloned a svn project repo using git-svn. When I fetch commits, how do I check that there are no commits to be merged left for all branches from the fetch I did?
JonathanC
  • 197
  • 1
  • 1
  • 10
1
vote
2 answers

How to make git ask before doing complex merge stuff like deleting files?

So we finally have git set up but I'm really confused how to handle multiple people merging. I have a branch, test, that I merged a feature in to earlier today. The other developer has now merged his new feature into test, and in the process - since…
Andrew
  • 5,095
  • 6
  • 42
  • 48
1
vote
1 answer

How to have rebased easily all depending branches if I changed one of the branches they are depending on?

I am trying to find a good solution using git to manage a big project in a flexible way for different platforms, clients, features... As a simple example (in order to understand what it's my problem, but in reality it will be more complex) suppose I…
Charlie
  • 152
  • 1
  • 12
1
vote
1 answer

Git merge and preserve original committer

how can i preserve original commiter, when i merging changes made by another developer? (Something like git merge --preserve-comitter) cherry-pick is almost good, but it seems does not preserve informations about branches Here is an image of history…
Mailo Světel
  • 24,002
  • 5
  • 30
  • 40
1
vote
1 answer

My changes are deleted during merge with master after revert

I have merged a development branch into master. But it was discovered the merge introduced bugs to master, so I reverted my commit. I have fixed the bugs, but when I try to pull from master into my branch, I see that this will delete many of my…
Alx Mx
  • 177
  • 9
1
vote
1 answer

Combine several Git repositories into one (with subfolders) and preserve individual file history

I am trying to combine several Git repositories into one. I have the folowing individual repositories: -mainrepo -repo1 |-src |-pom.xml -repo2 |-src |-pom.xml -repo3 |-src |-pom.xml I want to combine them into the folowing structure in…
Solaris
  • 11
  • 2
1
vote
0 answers

Trying to pull remote repo to local

What I am trying to do was pull from remote repository to local. I had an issue with "refusing to merge unrelated histories. I got an answer from SO. I wrote a command of git pull origin master --allow-unrelated-histories it took me from regular…
miPythOff
  • 43
  • 5
1
vote
0 answers

How to resolve rename/delete git conflict in favor of their delete during a pull

TL/DR How can we make git merge prefer their deletion over our move ? I tried git merge origin/develop --strategy-option theirs but this results in (trimmed) $ git merge origin/develop --strategy-option theirs ... CONFLICT (rename/delete):…
carl verbiest
  • 1,113
  • 1
  • 15
  • 30
1
vote
2 answers

What a Git merge of a branch has brought to master?

Colleagues, do I correctly understand that there is no automatic and general answer to seemingly simple question "What a Git merge of a branch has brought to master"? For it to answer - we need a reliable way to find a commit where master and branch…
Max
  • 1,741
  • 3
  • 23
  • 40