Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> `git checkout branchname` does nothing except make HEAD point to the commit

You probably know this, but since we are being pedantic we might as well get it right: That describes "git reset". "git checkout" does that and record that we are tracking branchname. So any commits will move both HEAD and the branchname reference.



Well along those same lines, making a commit doesn't move HEAD, it's still pointing at the same branchname as before.

  cat .git/HEAD




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: