开发者

Git branch unknown to local clone

I have a git repository with two branches. If I clone my repo I can only see the master branch. I have both branches up to date. The problem is I don't fully understand merging and branching. Darn it!

My example can be seen here:

http://github.com/rimian/rimian/network

Can anyone tell me how to get this back to n开发者_如何学Goormal?


You have both branches in your cloned repository, but they are called origin/master and origin/ui. By default, it will also have created a local branch called master that tracks origin/master, and this is what you see when you do git branch for example. You can see all remote branches with the command git branch -r. You can create a new local branch that tracks the remote one, and switch to it, for example with git checkout -tb ui origin/ui.


When I run

git clone http://github.com/rimian/rimian.git
cd rimian
gitk --all & # You can also use git branch -a if gitk is not installed

gitk shows me an ui branch and a master branch. I could for instance run

git merge origin/ui
git push

To get the contents of the ui branch into master and update master on github.

Please note that I did not use the url you posted when cloning. I recommend you read this github guide on branching/merging

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜