![]() This creates a new pointer at the same commit you’re currently on. You do this with the command ‘git branch development’. Let’s say you create a new branch called development. When you create a new branch in Git, it creates a new pointer for you to move around. If trying to understand in a visual manner, it looks like this: Every time you commit, it moves forward automatically. ![]() It is created as soon as you create your first commit in the git repository. The default branch name in Git is master. Similarly, in last 2nd commit, the parent value is the hash of last 3rd commmit.Ī branch in Git is simply a lightweight movable pointer to one of these commits. In last commit, the parent value is the hash of last 2nd commit. Let’s get details of last 2 commmits by running git cat-file command. This will allow us to view one commit per line: For this, we’ll open git bash shell and run command ‘git log –oneline’. To consider an example, let’s revisit our commit history that we created for project ConsoleApp02. When you make a commit in Git, Git stores a commit object that contains a pointer to the snapshot of the staged change, few other details such as author, commit message and previous commit information. If you may remember correctly, Git does not exactly stores data as series of changesets or deltas, but instead as series of commits. To understand about git branching, we need to revisit few concepts that we have already discussed in previous blog posts related to integration of git and visual studio. In this post, we are going to discuss about concept of branching in git and how it works. We also discussed how to amend previous commit as well and understanding its command line equivalent git commands. Basically, we discussed how to stage changes selectively or whole and then committing those changes. In previous post, we discussed on the commit variations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |