This article teaches you what is Commit History.
Now let’s see Committed History
- git log: This command shows a list of all the commits made to a repository.
Let’s discuss this output step-by-step. Each entry returned by the git log command contains:
-
The author of the commit. In our above example, this was saroth. The email of the author is also specified.
-
The date the commit was pushed. In our above example, this was Fri Oct 7th.
-
The message associated with the commit. The commit message returned above was “Initial Commit”.
All this data gives us useful information about the commits in our repository.
2. git checkout : This command is used to see how our project saw before we committed a specific record.
Here below you can see there are some features and files deleted after the initial commit. So, this command is used to see how our project saw before we committed a specific record.
After that checkout again you type the git log command, Now git bash shows:
Only initial commit here. All subsequent commits after the initial commits are deleted. If need to go the present type in your git bash
git checkout master
Now all files add our project directory again. If you need to see all commit in one line:
git log –oneline
If you need to see what are changes in one file?
git log –oneline index.html
If you need to see what commits are held within the specific period.(since to until)
git log –oneline
If you need to see what files are affected in these commits.
git log –stat
Note: The git checkout command lets you navigate between the branches created by the git branch.
I hope this is useful. If you want to interested in watching more videos about git. Please watch Appslanka git videos on our youtube channel. https://www.youtube.com/playlist?list=PLZmKantulzuSeqMy-zM56ZC0S7watreeu. Don't forget to subscribe.
0 Comments