4

I have two branch :

:git branch
  dev1.1
*  master

I have some local changes to the master I want to push. How do I specifically push master branch only?

Billal Begueradj
  • 13,551
  • 37
  • 84
  • 109
Vacassal Alsk
  • 341
  • 1
  • 4
  • 18
  • https://git-scm.com/docs/git-push – axiac Sep 25 '16 at 17:52
  • 2
    Possible duplicate of [How to push a new local branch to a remote Git repository and track it too?](http://stackoverflow.com/questions/2765421/how-to-push-a-new-local-branch-to-a-remote-git-repository-and-track-it-too) – paulsm4 Sep 25 '16 at 17:53

4 Answers4

8

You can use the following:

git push <remote_alias> <branch_name>

So in your case, it would probably be:

git push origin master

Cisplatin
  • 2,372
  • 3
  • 28
  • 49
4

If you have already committed your change, then you can push your changes to remote from any branch.

git push origin branch_name

In your case, branch is master.

Shravan40
  • 6,849
  • 5
  • 21
  • 43
1

you could use something like this:

git push git@github.com:bliep/blup.git fork-feature:feature

This will push your local fork-feature branch to the feature branch of the git@github.com:bliep/blup.git repository! I use this to help out colleagues with their PR's sometimes.

Elmer
  • 8,198
  • 1
  • 41
  • 34
-3

If the history of your branch has changed and it is pointing to a different tip of the head, you'll need to do a force push as follows:

git push origin master - - force
ValyriA
  • 127
  • 1
  • 9