Elijah
Elijah

Reputation: 281

Pushing branches to github

I have local git repository on my pc with 2 branches, let's say branch1 branch2

I have a remote github repo setup. So far I've been working with only branch1. Now I have switched to branch 2 and have been working with it for a couple of days. I have no problem doing

git push origin master

and I receive

Enter passphrase for key '/c/Users/elijah/.ssh/id_rsa':
Counting objects: 39, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (21/21), done.
Writing objects: 100% (25/25), 2.44 KiB, done.
Total 25 (delta 7), reused 0 (delta 0)
To [email protected]:los123/Apptwit.git
   5e6004f..7572482  master -> master

So things look pretty normal, it's just when I go to my github repo I:

  1. see only master branch there

  2. I don't see the last commit I did from branch2 (even though it was successful)

Can anybody clarify what is going on? (is it by design that I can only synch one branch with github?) Thanks you.

Upvotes: 0

Views: 103

Answers (1)

mpartel
mpartel

Reputation: 4492

git push -u origin branch2

(The -u sets branch2 to track github's version of branch2, like your master probably tracks github's master. Affects things like git status showing "you are ahead by N commits")

Upvotes: 3

Related Questions