问题
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