I have 2 branches in my local, for example:
- FirstApp
- SecondApp
How to push both of them to remote repo? Do I also need to create two branches in remote as well?
Many thanks!
You can do it by executing the following command.
git push [remote name] [branch1] [branch2]
For example if you want two put branch FirstApp and branch SecondApp to the remote origin, you can execute
git push origin FirstApp SecondApp
If you want push more branches, just add the branch name that need to be pushed to the end.
For more information about git. You can checkout this book from the following link - http://git-scm.com/book
With recent change in the default push policy, I would advise:
git push -u origin FirstApp
git push -u origin SecondApp
That way, even with the new 'simple' policy, it will push and create an upstream branch named after your local branches.
Now keep in mind that if you clone back your remote repo, it will not create local branches for all the remote branches: see "Track all remote git branches as local branches".
To see if your branches were pushed after a new clone, check out the result of:
git branch -a
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