More importantly, Tower will also explicitly warn you in case you're trying to commit in such a state. In case you are using the Tower Git client, the app will prominently inform you when you're in a detached HEAD state. This means they can easily get lost once you check out a different revision or branch: not being recorded in the context of a branch, you lack the possibility to access that state easily (unless you have a brilliant memory and can remember the commit hash of that new commit.). The consequence is that when you make changes and commit them, these changes do NOT belong to any branch. When you instead choose to check out a commit hash, Git won't do this for you. You are automatically on the newest commit of the chosen branch. Normally, when checking out a proper branch name, Git automatically moves the HEAD pointer along when you create a new commit. The HEAD pointer in Git determines your current working revision (and thereby the files that are placed in your project's working directory). This exact state - when a specific commit is checked out instead of a branch - is what's called a "detached HEAD". However, you can also provide the SHA1 hash of a specific commit instead: $ git checkout 56a4e5c08 Normally, you use a branch name to communicate with "git checkout": $ git checkout development Git then places all of that revision's files in your working copy folder. With the " git checkout" command, you determine which revision of your project you want to work on. Download Now for Free Understanding how "checkout" works
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |