Git branch named origin/HEAD -> origin/master

前端 未结 3 399
轻奢々
轻奢々 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:08

    As far as I know, HEAD is not a branch, but rather a pointer to a node of the history tree (i.e. a commit). The files which are residing in you particular working copy have the state described by HEAD.

    Usually HEAD points to the most recent commit in a branch, so you have the most recent files in the working copy. Using git reset HEAD^ you can shift the pointer to previous commit (i.e. undoing the last commit in your local copy).

    Now, every git repo has a HEAD, check this with git show HEAD. Accordingly, origin/HEAD is HEAD of your origin remote.

    Now, I've found a good question describing HEAD: What is HEAD in Git?

提交回复
热议问题