![]() I will simply give an illustration to make it more comprehensible. These are amongst the most common misunderstood concepts when starting to learn git. Get back to master now, we will continue. HEAD moved to point to the feature2, huh well that was simple enough. In order to prove our point let us execute git checkout feature2. By the way HEAD~ is the same as HEAD~1 so no fancy stuff there, we programmers are lazy you know. ![]() Thus HEAD~1 is like saying "the commit above HEAD" and similarly HEAD~2 is equal to saying "the commit 2 steps above HEAD". Now in order to mark other locations, we might need a reference point right ? That is for instance, if I need to explain someone where the commit refactor is, I can just say go 2 commits above HEAD and there you will find it. Simply accept HEAD as an arrow pointing to your location on a map. We will move HEAD from time to time in our visual graph, but what is this magical special word to begin with ? Let me explain, HEAD is nothing more than a pointer in your git workflow, it just marks where you are. By doing so, it is going to allow us to notice the relationship between the commands and the bahavior of git. In order to make it more understandable, I will show you how visual representation changes while we execute the corresponding git commands. We also have HEAD which we will talk about in a bit. ![]() As you see, we also have 3 branches, master, feature1, and feature2. First we have an initial commit (root of our tree) at the top, after which we have 3 commits ( added contributors, improvements and refactor), whose parents are the same. This is our repository and it has several commits and branches in it. Well today I am here to show you the peculiar aspects of this tool and how we can deal with trouble.īelow representation will be our visual work space. You all probably have used git at some point in your development stages and familiar with the basics. Yep, sometimes git can be complicated, but that does not mean necessarily it can not be understood unless you are a git expert. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |