Is there a way in git to merge two branches without merging file? In other words just to draw the merge arrow.
Let say I have branches A and B. I need to merge branch B to A, but no need all the changes in B, but rather only need to link to branches together.
git checkout A
git merge B --no need changes
In general is there a way to merge two branches without submodules. I want to keep submodules as it is in Branch A and still need to merge branch B.
With --no-commit perform the merge and stop just before creating a merge commit, to give the user a chance to inspect and further tweak the merge result before committing. Note that fast-forward updates do not create a merge commit and therefore there is no way to stop those merges with --no-commit.
Merging Branches in a Local Repository To merge branches locally, use git checkout to switch to the branch you want to merge into. This branch is typically the main branch. Next, use git merge and specify the name of the other branch to bring into this branch.
Use git merge -s ours B
to perform a merge discarding any changes B would introduce. Still, the commits from B
are now in A
, however, the files are at the state of A
before the merge.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With