If you want to see the version evolution history of git, you can do this:
Open Git Bash and switch to the project directory
$ pwd
$ ll
$ cd git-rainbow/
$ ll
$ cd mtxcrm/
$ ls -la
In addition to the command line method, there is a more intuitive way to view the git version history through a graphical interface tool.
Enter the following command to open the git historical version graphical interface management tool
$ gitk
The git version history graphical interface tool is divided into upper and lower areas, as shown in the following screenshot:
The upper left corner is the history tree
Click on any node in the directory tree, which has the same background color as the node, and the upper right area is the specific commit information. The two lists on the right list the author information and change time respectively.
When there is a lot of version history information, especially when there is a lot of branch information, it seems easy to get confused. Let's go through each block one by one. As we click on different directory tree nodes, the following ID information is also changing
In addition, the information of Diff and Tree also changes
In the lower right area, in addition to clicking Tree, you can also click Patch. Patch refers to the change set corresponding to a certain change
The Diff corresponding to the lower left of the Patch is an enumeration of the change information of all the changed files in the Patch change set.
Switch to Tree, you can see the file directory structure under the current commit project
In addition to the different display forms, in Tree mode, when a file is selected, the entire content of the file is displayed in the Diff on the lower right.
In Patch mode, the Diff area on the lower left tells us what content has been added to this file through the + plus sign
When viewing the version history through the gitlog command before, there was only the author's information. Our gitk not only has Author author information, but also Committer committer information. Is there any difference between the two?
The commit of a certain change has both Author author and Committer committer. Is there any difference between Author author and Committer committer? Just think, under what circumstances are authors and committers different?
For example, there is a commit in the master branch, I pick it out and put it in the temp branch, that is to say, if a branch is picked out and put into another branch, the author and the committer may be different at this time. That is to say, there is an author before the pick, and the committer corresponding to the newly generated commit is yourself, but the content is picked from other branches, that is, git cherry-pick, I pick other people's branches myself Come over and submit in the new branch. At this time, the author still retains the author before picking, that is to say, in this case, the author author and the committer submitter are two different accounts.
And every change, usually with a parent parent, except which one doesn't have a parent parent?
The following node has only Child children and no parent Parent. Because it is the first commit in this repository. It has no parent, which means it has no parent, it only has a child, Child.
Then there are Branches, which refers to which Branches branches contain this commit
In addition, gitk also has a function, that is, you can customize the content of the view, click the menu item "View" > "New View" in turn
In the following view definition window Gitk view definition, check All refs all references.
What are all citations?
Including all (local) branches all local branches, All tags all tags, All remote-tracking branches all remote branches, All tags All tags refer to the marked branches.
Then click [Apply], [OK] in the window.
All of our current git operations are performed locally and do not involve remote situations.
That is to view the git version history on your own work machine. As shown in the screenshot below, we can get all the branches information
You can also click a commit message in the upper left directory tree, right click "Create tag" to add a tag
In the create tag pop-up window maketag, enter information in the tag name and message text boxes respectively, and click [Create]
As shown in the screenshot below, the original node name is replaced by the label name