Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: new branch not getting pushed

Tags:

git

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?

like image 699
SeattleOrBayArea Avatar asked Jan 18 '12 20:01

SeattleOrBayArea


People also ask

How do I force a branch to push on GitHub?

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.

How do I force a branch to push another branch?

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.

Why git push is not working?

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.


1 Answers

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).

like image 79
abresas Avatar answered Oct 08 '22 03:10

abresas