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

GIT rebase on a merged branch creates conflict

I am working on my branch which I keep merging with the master which works well. But the problem arrives when my pre-checkin pipeline starts by taking my SHA and tries to apply latest SHA from master via rebasing method. This always ends in…
Hacker
  • 7,798
  • 19
  • 84
  • 154
1
vote
1 answer

Which branch should be merged into which when a merge conflict occurs in git

I was wondering what the best approach to resolving merge conflicts in a certain scenario was. In this scenario there are two developers(A and B) collaborating on a project together, developerA is the project maintainer therefore should be in charge…
redd
  • 33
  • 6
1
vote
1 answer

Create copy of file on github repo but use it for different content

I have a file in github called test1.py I want to use all of its content and just change 1 line. So i created a new branch, copied test1.py, then deleted test1.py, and then pasted it in a different location in the same repo. Then renamed it to…
1
vote
1 answer

What is best practice for a long running Git branch?

I've been reading the excellent Pro Git book to gain an understanding of git actions, however there is one scenario illustrated which I cannot understand from what the book is saying. In the section on Basic Branching and Merging, under the heading…
zkarj
  • 657
  • 9
  • 23
1
vote
1 answer

How to merge the master branch commits to feature branch after revoking all the feature branch related commits?

I have a scenario where there is a master branch, and a feature branch is cut from the master branch. Master branch Feature branch all our custom changes to the code are committed to the feature branch for custom configs testing. Meanwhile there…
Karthic.K
  • 416
  • 5
  • 15
1
vote
0 answers

Lowest storage way to create a domain branch with clean history?

How can I create a new domain branch without duplicating revision history? By domain branch, I mean something like "mac", "windows", "serialization", configuration, or another domain of the application — larger than any feature, but smaller than…
1
vote
0 answers

Resuming merge conflict resolution in a remote repository

Following on from GitHub subtree merge requests, I've been pondering whether a merge conflict that arises during a(n automated) git subtree pull could easily be "stored" somewhere in order that it can later be "resumed" on a different (manual) copy…
eggyal
  • 122,705
  • 18
  • 212
  • 237
1
vote
1 answer

To keep two unique versions of files within two branches permanently or similar solution

Let me explain. A "branch" of our firm in another town is also going to use our app created for our specific purposes. But there are bunch of files that will be different for them permanently, other are common. I'm looking for a solution that will…
Damian K.
  • 172
  • 8
1
vote
3 answers

git merge reverted but the changes needed

I have a feature branch, let's call it A, and a main line, let's call it B, where we deliver. The problem is the following: Branch A was many commits ahead of branch B, nothing extraordinary so far. So I did a merge from branch A to B. Then I…
Tamas
  • 736
  • 2
  • 11
  • 27
1
vote
2 answers

What is the Git CLI equivalent of "Keep Current" in Visual Studio Git Changes window?

In Visual Studio, I can easily take the current (or incoming) branch's changes while resolving merge conflicts. This is like merging with --ours (or --theirs) merge strategy for a single file. Could someone please tell me how I would do this on the…
Peter Bergman
  • 472
  • 4
  • 16
1
vote
1 answer

How do I pull values from another branch onto my local branch?

I am new to git and I am running into the following issue- I created a branch 'Test' from develop. I am trying to pull changes from branch 'Working' (which is also based on develop) onto my local branch. I don't want any of my changes to affect…
1
vote
1 answer

Remerge MR in GitLab

I did a Merge Request and already merged it, but want to edit commit messages squash/unsquash commits, etc. I know that I can do something that via git commit --fixup/git rebase into merged branch, but what will be with the MR itself? Will it be…
k1r1t0
  • 465
  • 2
  • 11
1
vote
1 answer

merged changes isn't considered as a change in the branch that i merged into

i have a simple question, if i have a branch called a then i checked out another branch from that one, called b, i made some changes in b, commited, then pushed it, and merged b back into a. now a gets the changes locally on my machine but not in…
1
vote
0 answers

How to resolve merge conflict using 'theirs' then 'mine' for a specific file during Git pull/checkout

I work on a file (dbscript.txt) which is used by multiple developers frequently and thus it goes to conflicting status very fast. So, to push the changes I pull, resolve conflict and then push it again. Is there any way with which we can…
NetUser
  • 31
  • 3
1
vote
1 answer

How can I bring commits into a branch from another branch based on when they were created after cherry picking and merging?

Consider that I have two branches: master and staging. Commit C was made on staging and cherry-picked into master urgently, so it's already there. -x-x-x-A-B-C-D (staging) / -x-x-x-C (master) Later, another branch feature was merged…
Timothy Fisher
  • 1,001
  • 10
  • 27