I created a branch, say "dev" which was based off say branch "Base" and then merged it with Upstream content (I want to keep Base clean till I am done with my testing). After resolving conflicts, I ran the command git commit -a -m "comment" and it went through. Next, I ran git push, hoping the new branch would be created on the git server and also my merged content on dev will be seen. But, when I ran git push, the command gave output "Everything up-to-date" and I do not see the new branch on the git server. Is there anything that I am missing?
To force a push to only one branch, use a + in front of the refspec to push (e.g git push origin +master to force a push to the master branch). See the <refspec>... section above for details. Force an update only if the tip of the remote-tracking ref has been integrated locally.
Push Branch to Another Branch In some cases, you may want to push your changes to another branch on the remote repository. In order to push your branch to another remote branch, use the “git push” command and specify the remote name, the name of your local branch as the name of the remote branch.
If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.
See if you have created the branch on the remote repo:
$ git branch -av
You probably haven't. You can create the branch by explicitly stating you want to push it:
$ git push origin dev
By default git pushes all branches that have a respective branch on the remote (new branches don't).
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