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

Release branch process - how to merge release branches

We are adapting to trunk-based development with release-candidate branches. (at the moment we are using trunk-based development, but without release candidate, which is not sufficient anymore) There is nice description on google:…
libik
  • 22,239
  • 9
  • 44
  • 87
1
vote
3 answers

How to correct bug in merge - squash fix commit to merge commit

this should be probably very easy, but I am not able to solve it out. I introduced bug in the merge, and than I corrected it in additional commit. I would like to squash the "bug fix" commit to the merge commit so it looks like the bug was never…
Jakub Znamenáček
  • 766
  • 1
  • 4
  • 18
1
vote
2 answers

Is it safe to use git rebase on a shared feature branch?

A colleague of mine created a feature branch feature/dotnet6 from our main branch developing to work on migrating some of our .NET Framework projects to .NET 6. His feature branch has been around for a while now and is 19 commits ahead and 218…
1
vote
1 answer

Confusion about Git tags, merge requests branches and references

Some context: I have a monorepo with a release process where we create a branch, generate a release commit inside the branch, create the according tags and then that release branch gets merged to our target protected branch (main). My question is:…
mca
  • 13
  • 3
1
vote
2 answers

Merge two git repositiories, with separate roots and histories, into one

This is what I have RepoA: root ➊ → ⋯ [History A] ⋯ → ➌ RepoB: root ➋ → ⋯ [History B] ⋯ → ➌ where the files (➌) in each repo are now identical, but the histories and roots are entirely unrelated. This is what I want, but both Git and related…
1
vote
1 answer

How to configure git mergetool properly for neovim?

I'm trying to use neovim as git mergetool but it is not working as expected or as I understood from the documentation. Here's my .gitconfig: [user] name = Augusto [pull] rebase = true [diff] tool = nvimdiff guitool =…
Augusto
  • 1,234
  • 1
  • 16
  • 35
1
vote
1 answer

Perform Github action to automatically merge when I create a pull request

I'm setting up Github actions for a few of my projects. The flow I'd like to achieve is: A developer opens a new pull request The branch is automatically merged with the main branch My question is, is it possible to achieve this kind of workflow?…
eyah
  • 111
  • 1
  • 8
1
vote
1 answer

Git - How to import history after squash commit was done

While consolidating repos, I was able to merge history to a single repo successfully, into a feature branch (not master branch), using the --allow-unrelated-histories parameter. Issue is, we are using Azure DevOps, so when I pushed the changes to…
Greg
  • 3,861
  • 3
  • 23
  • 58
1
vote
2 answers

How could I move all my files and folder to the master branch in GitHub?

I have a GitHub repository with 2 Branches: master , engineers. All my files and folders are in engineers branch. The master branch is empty. I downloaded the GitHub Desktop, login using my GitHub account, then clone the project. Now, I want to move…
sysSTD
  • 87
  • 6
1
vote
0 answers

Allowing git mergetool to create multiple tabs in meld?

This question shows how to set meld as the git mergetool, and notes If you have more than 1 file with merge conflicts then git will open a new Meld window for each, one after another until they are all done. Setting up and using Meld as your git…
Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
1
vote
0 answers

Git Merge local branch and remote branch , Change project files

I brought the project on the Git and ci-cd, I have two develop and master branch, which with each commit on the master automatically pull on the server. For example, the user applies changes to the latest version on develop, and when he wants to…
1
vote
0 answers

Validate commit message contains Jira Ticket Number when squash merge from GitHub webUI

When doing a squash merge, following a successful Pull Request, on github I would like to validate that the squash merge commit message contains a Jira ticket number. If it does not the squash merge should fail until a proper commit message is…
1
vote
1 answer

Git Workflow - Correct early errors

Let's say I have a branch Master With the following commits: M1->M2 Then from M2 a branch Feature is created and developed as: M2->F1->F2->F3->F4 Then a merge request is created from Feature and a code review is done where an error is found in F1…
Ivan
  • 1,352
  • 2
  • 13
  • 31
1
vote
0 answers

Git log not update file date modified

We generally work on two developer and master brunch On developer rice, when friends make changes and make a reduction, when sending to the server, it says that the developer local branch should be confused with the developer remote branch. Now in…
1
vote
1 answer

How can I create a pull request between branches with entirely different commit histories

I have two branches with entirely different commit histories, and I need to create a pull request - NOT MERGE - from one of them to the other. When I tried it gave me this: I tried to push a mutual commit, but this is not working. What is the best…
renad sahal
  • 147
  • 10