I have an application running in a git repository on a branch (say dev
). The application modifies the content in some the repository and commits them. I now have to merge these changes into another branch (say master
) but the snag is that I don't want to git checkout master
before doing this. Is there some way to say "merge current branch into master"?
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. This example merges the jeff/feature1 branch into the main branch.
Thus, if you want to ensure your branch is not changed or updated by the merge command, use --no-ff with --no-commit.
It looks like GitHub only allows merging of branches by making a pull request and then merging. Is there a way to merge mobile into master in a single step without cloning locally? There's no way without using a pull request.
The "master" in your case appears to be "fast-forwardable". You could "push" the branch to master.
cd /path_to_dir_with_no_branch_switch/ git push . appbranch:master
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