So Initially when I clone the repo it has two branches
*master
*develop
Then on my local machine I create a new branch from develop
git checkout develop
git checkout -b feature/new-feature
I am done with all the commit on my local machine and I want to it to merge with develop branch on github again.
git push origin feature/new-feature
Does this gonna create a pull request to merge into develop branch or master branch?
It won't create a Pull Request automatically.
It just pushes the branch to the remote.
If you want to have a pull request, you will have to create it yourself, except if you have a scriot that does it for you.
You can decide what target branch to use when creating the pull request.
Note that pull requests are a feature of some git servers (like GitHub) and not (directly) a feature of git.
Pushing the new branch will create that (exact same) branch on the server. If you want to merge it in an existing branch, you can do this either local(git merge
command) or by creating a new pull request if the server supports it.
git push origin feature/new-feature
will create a push to your new branch feature/new-feature
. Not in master
or develop
branch
If you want all changes in the develop
branch, you must merge from feature/new-feature
branch like git merge develop
.
Nice explaining -> www.freecodecamp.org
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