git push fails in new branch
So I created a new branch in git by doing the following:
git checkout -b newbranch master
I made some changes in newbranch and committed them. git log shows my changes just fine.
Now when I do 'git push', I just get 'Everything up-to-date' even though nothing was pushed to the remote repository.
I am on git 1.开发者_开发技巧7.1
Grateful for any help!
Git doesn't automatically push all branches. Usually master
is the default branch to push, but you can specify by doing:
git push origin newbranch
Although, you might want to instead merge your newbranch back into your master branch and then push that.
Branches in Git are more geared towards your own personal development that doesn't need to be shared with everybody. One way to approach it is that you keep feature X hidden in a branch while you (and maybe a couple others) are hacking at it, and once feature X is done, you merge it back into master
and then share it with the rest of the world.
精彩评论