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

Confused with pull request for dev back into master, listing merged commit again and again

I use Azure Dev Ops and have a master branch and a very fresh dev branch that had master as "parent". Master has a policy that it can only be changed by pull requests. When I make some changes in the dev branch, commit and push them I want those…
Patric
  • 2,789
  • 9
  • 33
  • 60
1
vote
1 answer

Merging multiple feature branches into master without additional commit message?

Suppose you have a master branch: A--B--C Feature 1 Branch: A--B--C--D Feature 2 Branch: A--B--C--E When we do a git merge Feature1 into master, it merges fine, however when trying to merge Feature2, we are presented with vi asking us to enter a…
1
vote
1 answer

With git, how to force overwrite a file in one branch, from a file in another branch (bypass merge), and commit?

I have a single file in a branch called 'production' that I want overwritten by a specific file in another branch called 'sqa'. The nature of the file is that it is not code where there are multiple contributors. What command would do this? …
user10664542
  • 1,106
  • 1
  • 23
  • 43
1
vote
2 answers

How do I force Git to allow me to resolve all merges manually during a rebase?

I'm attempting to rebase a local development branch onto the latest version of master in order to incorporate the newest changes. However, this development branch is for cleanup work, so its commit history looks something like: Normalize YAML…
macdjord
  • 517
  • 2
  • 4
  • 13
1
vote
2 answers

How to select the file version from master during a rebase?

I started a rebase of my branch over an updated master. During the rebase there were a few conflicting files which were resolved easily. However, one file is a huge header containing hundreds of macro definitions, which are all conflicting. I want…
ysap
  • 7,723
  • 7
  • 59
  • 122
1
vote
2 answers

Why git log graph of merged branch from GitLab was inverted?

As you can see in the image, feature branch number 668 has been merged into dev branch. But why the git graph appears like dev branch was merged into branch number 668 instead? This behavior seems to happen only when do a merge request from…
Preeti Y.
  • 429
  • 4
  • 11
1
vote
1 answer

How to get changes from another branch limiting by date on git

I have a Branch called "hugefeature" which was forked from "master" on January. People worked all the year on this "hugefeature" branch, and also on "master". But since July, all the changes made on this branch are not important. In fact, this…
Daniel Ribeiro
  • 498
  • 1
  • 4
  • 15
1
vote
1 answer

Configuring vimdiff splits with specific statusline / line-numbers

I'm trying to set up git mergetool to spawn vimdiff with the following splits (and a configuration customized to each split): Splits from the following buffers $LOCAL, $BASE, $REMOTE, & $MERGED (horizontal) [done] Show line-numbers per split…
Mike Pennington
  • 41,899
  • 19
  • 136
  • 174
1
vote
2 answers

Find Conflicting files while merging two git branches

I have my main branch 'master' and two derived branches 'branch-a' and 'branch-b'. when i try to merge 'branch-a' in 'branch-b' github desktop checks: and shows that there will be two conflicting files, these could be code files or dll or images, i…
1
vote
1 answer

git should give me operation as conflict when same file modified in different branches

Lets consider file.txt aaa bbb ccc In branch A, I'm changing file content file.txt aaa-update bbb ccc In branch B, I'm changing file content file.txt aaa bbb ccc-update When I merge branch B into branch A I get below…
1
vote
3 answers

Safest way to merge my branch into master branch?

I have a branch called file_migration and I wanted to merge it with the master branch. I only want the files I have updated/added to be merged into master branch. If other people have made changes to master branch that are not captured in my branch,…
Stanleyrr
  • 858
  • 3
  • 12
  • 31
1
vote
3 answers

Does git merge -s ours strategy preserve the commit from garbage collecting?

In our project we have a model comparator that checks the performance of the code and saves the statistics together with the git hash of the commit. The problem is that in many cases this commit becomes orphaned later, and we cannot retrieve the…
Dmitry Kuzminov
  • 6,180
  • 6
  • 18
  • 40
1
vote
1 answer

Resolve merge conflict between two branches with no push privilege

Given branch development to be merged into integration both branches do no permit push while merging there is a conflict $ git merge development Auto-merging .gitlab-ci.yml CONFLICT (content): Merge conflict in .gitlab-ci.yml Automatic merge…
soufrk
  • 825
  • 1
  • 10
  • 24
1
vote
1 answer

Revert a revert from a month ago

I've made a merge a month ago on a repo, then reverted it. Now it causes me trouble when merging because when I try to merge it deletes some files that has been deleted in the revert, but now I need them. And since the commits that deletes them is…
Architek
  • 53
  • 5
1
vote
2 answers

Will there be a conflict when doing a merge after removing a particular branch folder?

A project has two branches: master and dev. Suppose a folder was removed from the dev branch, but not the master. If a commit is sent to GitLab, will there be a conflict when merging?