That now means that the new-branch has diverged from main for one commit.ĭeleting a branch is also cheap in git, however, if we would try to delete new-branch, git will raise a warning and not let us. git/refs/heads/new-branch file was updated with the new hash commit. commit on new-branchįrom the output above we can see that the. What happens when we add a commit to the new-branch? Let's see. Cheap in a sense of resources that are used in order to create one - just a text file with a commit hash in it, not the snapshot of the whole working directory, for example. That is why creating branches in git is cheap. It will look something similar to the below snippet: $ ls. This directory contains the file with the branch name and the content of that file is the commit hash that it points to. What is a branch? To put it simply - it is a named reference to a certain commit. Unlike some warm-up videos, we will not start from the top-down (head-toes) approach, we will start with branches first, and then continue on explaining tags and in the end, last but not the least - the head. If you want to start from the beginning, checkout the first part of the story where we go through some of the git internals. This is a second article in the series about Git, and with it we will cover head, branches, and tags. I will show you what this means, how to fix it, and a bit more about it. If your head, god forbid, got detached, you wouldn't have with what to worry about anything, right? Well, in Git, this is a lot more different thing, and it is not a problem, even though git "screams" at you with a bunch of warnings.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |