So far, HEAD (current commit) and branch were in a normal, aligned state. Your branch is up to date with 'origin/main'. When you run git status, it tells you what branch you are on: $ git status If you limit yourself to checking branches only, you will never leave this state. Git moves your branch to this new commit.The typical workflow with Git is as follows: Your HEAD is a central piece of the state of your repository. a commit that will be used as a parent when you create a new commit. a reference point when you want to see the last changes to your working copy with git diff.HEAD is a pointer to the current commit-the place where you are in the repository right now. From Git’s point of view, your main or master branch is no different than lorem-ipsum. is just a convention the teams are using. They literally have no other data than the name and its position. What can be surprising at first is that branches are just labels. On top of this stable base, we have a dynamic part: branches. Git commits gives us a stable, complete history of the changes to the repository. The only way of making changes to the repository is by creating new commits. This is how our repository keeps data safe for us. Git commits are immutable-meaning you can create new ones, but what’s already inside will never be changed. To really understand what is happening, we need to look inside Git. You can look around, makeĮxperimental changes and commit them, and you can discard anyĬommits you make in thisstate without impacting any branches A common source of confusion when using Git is not knowing what it all means when you see an output like this: You are in 'detached HEAD' state.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |