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 merge results in a conflict in one simple case, but then no conflict in practically identical case? What is Gits logic?

Commit Graph -> Going Forwards in time --> A / \ O M \ / B O = Original commit A = Commit on Branch 1 (main) B = Commit on Branch 2 M = Merge Commit MyFile (Commit = O) ====== line1 line2 line3 MyFile (Commit = A ... only modifies…
matt
  • 49
  • 7
1
vote
2 answers

How do I undo a merge , after I merged a branch into master branch

Guys I want to unmerge this localdevelopment branch from my master branch , also I pushed the master to origin/master , so now the commit history has also changed in the remote where in master branch I am also seeing the commits of this…
1
vote
1 answer

Git ignores my changes after revert action

Guys I have the following scenario: I created a pull request with changes A,B,C (test-branch). I merged this branch to development (test-branch => development). I had to revert this merge; I merged new things from other branches; Now I want to…
Jota
  • 819
  • 6
  • 24
  • 41
1
vote
1 answer

Is there the technical possibility in Gitlab that a custom adaption of the repository content is Dome during the merge?

Is there the possibility that I can add e.g. a script which is executed during the merge Step in gitlab which can change some content of the repository? Standard Workflow which is fully Supported with GitLab Create Merge Request in GitLab Add it to…
bakerinc
  • 11
  • 1
1
vote
2 answers

Move a Git commit retrospectively to another branch in the history

I accidentally committed a general change on a development branch and already merged it to the master branch a while ago: * HEAD * ... * * 2c884bc Updated Gradle Root Project Name * 4926f6a Merge branch 'wip-dev-Logger' |\ | * 43161fb Revised…
Gumbini
  • 48
  • 6
1
vote
2 answers

See changes in a merge commit that do not appear in any parent

A merge commit can potentially introduce changes that did not appear in any parent commit. For example, when making changes to resolve conflicts or in the case of evil merges. Is there a git command to only see such changes in a merge commit,…
Nasif Imtiaz Ohi
  • 1,563
  • 5
  • 24
  • 45
1
vote
0 answers

Sync between Gitlab to Github repositories and delete different files and avoid Merge remote-tracking branch into HEAD

Note: I don't have admin privilege on GitLab so I can't use mirroring repositories. I need to do via gitlab-ci with git commands. I have got 2 different repositories. Source repo on GitLab, target repo on Github. Source gitlab repo contains files…
hammer89
  • 343
  • 1
  • 5
  • 13
1
vote
1 answer

git 'unmerged paths' - resolve strategy needed

was working on a featurebranch (spun off from main) for some while, commited it and want to merge it back to main. Unlike expected I get: error: Merging is not possible because you have unmerged files. hint: Fix them up in the work tree, and then…
vrms
  • 217
  • 2
  • 8
1
vote
1 answer

Git checkout to master from another branch updates automatically local changes?

I have an empty git repo in which first I create a hello.txt file with content "pulkitsharma". After this I added it to staging and then commited the changes in master branch. Then I create another branch named as "new_branch" and updated the…
Pulkit Sharma
  • 390
  • 2
  • 14
1
vote
1 answer

Prevent merging branch into master if it contains commits with specific text

My workflow: I have a master branch and a feature branch. When I'm done with the feature, I merge-squash it into master (then push master to remote, though not immediately, I may work on other features first). When working on a feature branch I…
lonix
  • 14,255
  • 23
  • 85
  • 176
1
vote
1 answer

Why does git merge ignore deleted files? Can I enforce deletions from the source branch?

I'm trying to set up an automatic merge/build system between two project branches, but I'm having trouble with deletions not coming over in my merges. Here's the setup. I develop on the main branch - add, modify, and delete files. All changes…
1
vote
1 answer

Git: master branch merged into master? (with graph picture)

I don't understand the following GitLab graph and I'm lacking vocabulary to express my question precisely. For reference, the graph below shows: linux-kernel stable repository mirror on GitLab Highest (most recent) commit: 7a31ec4d Lowest (oldest)…
NdFeB
  • 109
  • 12
1
vote
1 answer

Automate merge of master to develop branch using Azure DevOps pipeline

Requirement is to merge develop branch to master branch using pipeline so that it can be scheduled and merge will happen without any fail. I am trying to use 'Command Line Script' task in an Azure Pipeline with windows agent to perform the…
1
vote
1 answer

Wanted to merge code from one repository to another repository

I have two forked git repositories, let's say repo1- git@github.com:vikasgope/project1.git repo2- git@github.com:vikasgope/project2.git repo2 is created from repo1 some months ago. Now me and some other developers worked on repo2 and modified some…
Vikas Gope
  • 29
  • 6
1
vote
2 answers

git rebase and reset commits to source branch

I want to rebase my my-branch to staging-branch A---B---C---D---E staging-branch \ A5---A4---A3---A2---A1 my-branch After rebasing, I want to get all their commits and then mine. A---B---C---D---E …
RedFox
  • 1,158
  • 2
  • 15
  • 28