6

In my Android Studio project, I had one branch called myproj.

I've been updating and committing to it for a few days. I decided I wanted to work on a new feature and I'm not sure where it will take me so I created a new branch.

When I committed and pushed my new changes however, it seems to have only committed it locally but didn't push it. When I go to my Git repository it still says I have one branch.

How do I push this new branch to Git?

CodyBugstein
  • 21,984
  • 61
  • 207
  • 363

2 Answers2

5

You can push the branch in terminal (command prompt) by using following command

  • git push origin yourbranchname

    origin - your remote URL

    yourbranchname - the branch which you want to push

Anjaneyulu Battula
  • 1,910
  • 16
  • 33
0

(Used this approach to push branches to GITHUB. Hope this works same on others repo and private hostings as well.)

I opened git in terminal and typed:

git push --all

Then:

Press Enter.

Enter credentials.

Done.

devprashant
  • 1,285
  • 1
  • 13
  • 23
  • Further detailed explanation: http://stackoverflow.com/questions/6865302/push-local-git-repo-to-new-remote-including-all-branches-and-tags – devprashant Jan 19 '16 at 06:44