Git branch named origin/HEAD -> origin/master

前端 未结 3 441
轻奢々
轻奢々 2021-01-30 08:40

I\'m fairly new to Git, and still getting the hang of it. I just recently started working with branches and am running into some questions.

I have two development system

3条回答
  •  不要未来只要你来
    2021-01-30 09:07

    HEAD usually points to the currently checked out branch. In hosted (bare) repositories, it designates the default branch, i.e. the branch that is checked out when you clone the repository. So, origin/HEAD tells you the default branch of origin.

    I don't know why it's not present in your repository on the Ubuntu system. Perhaps you originally pushed your code from that repository (when origin was empty and thus didn't have a HEAD yet) and never updated it.

    Having something like origin/HEAD is not terribly important in practice, anyway. If you want, you can use git remote set-head origin -a to have origin/HEAD created/updated

    To answer your other question: if you run git pull without arguments, it actually fetches everything from the remote (git fetch is run without arguments, too, so it just gets everything). Everything doesn't get merged, though. Only the remote-tracking branches (the stuff in git branch -r) are updated.

提交回复
热议问题