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
0 answers

Change author of commit on GitHub and Pycharm

I started using Pycharm recently for a project. I have linked my GitHub account so I could commit directly in my repos. However the author name of the commits is not the username I have on GitHub. I used git config --global user.name "New Name" in…
Antonio
  • 111
  • 9
1
vote
1 answer

Replicate IntelliJ merge commit details functionality in CLI + vanilla git

IntelliJ has very convenient Git log functionality for inspecting merge commit details (see screenshot below + https://www.jetbrains.com/help/idea/log-tab.html#changedFiles). It shows "combined diff", a comparison of merge result to each of parent…
Max
  • 1,741
  • 3
  • 23
  • 40
1
vote
1 answer

How to merge large number of changes info common repo?

There are two developers working on branches dev1 and dev2, respectively, and usually every time one of them commits a change they do a PR into a common dev branch. Both developers have made a bunch of big changes, some of which may affect the same…
gkeenley
  • 6,088
  • 8
  • 54
  • 129
1
vote
1 answer

How can there be a merge conflict if I specified -Xours?

-Xours should mean that during merging one option always gets picked. So why do I still get merge conflicts?
Nimitz14
  • 2,138
  • 5
  • 23
  • 39
1
vote
1 answer

git merge-strategy for golang column style

does anyone know a git custom merge strategy for golang styled files with the column-format of the go-stylesheet? situation Assume having a struct like this: type Foo struct { Bar bool `json:bar` } now two branches are modifying this…
blaimi
  • 749
  • 5
  • 14
1
vote
1 answer

git merging two "master" branches whilst keeping them in separate directories

I have a repo that have 2 master branches master_v1 and master_v2 (these get deployed as 2 different services). master_v2 was created from master_v1 some years ago, but development has continued i both branches ever since. Now I'm fed up with…
Martin
  • 21
  • 3
1
vote
1 answer

How to re-commit after a rollback in git

I had a set of changes in the master branch, then I had to roll it back to a previous tag from production and do a hotfix since I didn't want the set of changes to go into production yet. So what I did was, I branched out backup branch from the…
JsbDev
  • 23
  • 6
1
vote
1 answer

Git merge says up to date but my files didn't change

I have 2 branches, main and Android. Android branches has some plugins for android environment. I updated my android with main branch, git history shows changes but when I inspect files there is no changes. Even git diff shows my files is not same…
Burak I.
  • 13
  • 3
1
vote
1 answer

How to undo code that is pushed to main branch and merged

I want to undo my push to the main branch which is merged as well. Note: I remember that pushing to the main branch isn't a good practice, but there were some commits showing in my main branch of the local repository. So, just to check these…
Fuaad
  • 197
  • 15
1
vote
1 answer

How to merge up to specific commit id from a remote branch in Git

I am working in a forked repository, where all my development work is on the local repo, but then merged back into the fork. We have a long-term development branch, that I would like to sync up with main on occasion. However, because of the…
EZ Pickins
  • 43
  • 5
1
vote
1 answer

If a pull request from branch A to branch B has conflict found, after resolving it, the merge always happens in bidirectional way. Why is it so?

When we merge a pull request from branch A to branch B, we expect only the changes in branch A to go into branch B. If there's no conflict found in the pull request, the merge behaves just like we expect. However, if there's any conflict, after we…
1
vote
1 answer

Gitlab | How do I prevent from the creator of the merge request to merge

I'm using gitlab and I just configured that in order to push to master, a merge request must be created BUT I don't want the merge request creator to be able to merge the request himself. I want all the members in my team to be able to create merge…
Tal Levi
  • 363
  • 1
  • 6
  • 22
1
vote
1 answer

Git merge with KDiff3 : navigate through automatically solved conflicts for review?

I am using Kdiff3 as my mergetool for Git. Upon running git mergetool, KDiff opens and a pop-up box shows up telling me : Total number of conflicts : n Number of conflicts solved automatically : a Unresolved conflicts : n - a At the top of the GUI…
Charles
  • 988
  • 1
  • 11
  • 28
1
vote
1 answer

Git command to get id's of opened merge requests

refs/merge-requests/*/head return all list of merge request (merged & opened) is it possible to get id's of opened requests only? without gitlab cli all merge requests: 1, 2, 3, 4, 5 closed: 1, 2, 3 git terminal command return only: 4, 5
1
vote
2 answers

How can I permanently merge one git repository into another?

I have one git repository which is included within another git repository; how can I merge the inner one into the outer one permanently while keeping its commit history? For a more illustrative explanation, here's my directory structure: [dev] >…
mzi
  • 307
  • 3
  • 10