import all branches from github

孤街醉人 提交于 2019-12-08 00:10:29

问题


I set up egit to work with my GitHub repo on my university computer.
The repo has 5 branches including master and my local copy also has those branches so I can go to Team -> Switch to and select the desired branch in eclipse.

On my laptop I set up Egit and cloned the repo.
I selected all branches when importing however under Local in the git repositories tab it only has master, all the other branches are under Remote Tracking.
If I switch to a Remote Tracking branch make a change, commit and then push I get the following error:

An internal Exception occurred during push: Nothing to push.

Anyone know what I am doing wrong? thanks


回答1:


If I switch to a Remote Tracking branch make a change, commit and then push I get the following error

You didn't create a local branch from your remote tracking branch you just switch to.
That means you are in a detached HEAD mode, hence the "nothing to push".
See "Git Lesson: Be mindful of a detached head":

(No HEAD:)

Team -> Switch To -> New Branch

will be enough to fix the issue, and then push it to the remote.

(HEAD on the new branch:)



来源:https://stackoverflow.com/questions/9267805/import-all-branches-from-github

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!