Answer the question
In order to leave comments, you need to log in
How to merge 2 local branches?
I have master
and feature
. But feature
not a merger with the master, and so far it cannot be merged remotely. Can this be done locally? Because when I push the changes from the remote branch feature
to my local branch feature
and work on it, then everything is fine, but as soon as I switch to a new branch, all the changes fly off.
Answer the question
In order to leave comments, you need to log in
Can this be done locally?
Of course you can! After you switch to a new branch (I understand that you mean local master
), merge with the branch with the feature
command:
git merge feature
This way you can check how your edits will work after they are accepted in an external repository (probably GitHub?). The main thing is not to try to send (git push) the master branch later. Since most likely the workflow involves working through pull requests on the server (Pull Request)
It seems that you have a mess in your head and do not understand what you are asking.
Make another branch and merge there. If everything is fine, then merge with the main
It is possible, but not necessary. When switching, commit the changes or use stash.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question