Git and Github Tutorial - Navigating the commit tree - Part 8

Hi, Today in iThePro we will learn how to use Git and how to use with Github to build software and develop it. In this part we will see how to Navigating the commit tree.

Getting more from the commit log:
git log --oneline
git log --oneline -1
git log --since="YYYY-MM-DD"
git log --since=2.weeks --until=3.days
git log --author="author name"
git log --grep="Name"
git log <commit-ID1>..<commit-ID2> --oneline
git log <commit-ID1>..<commit-ID2>  <file-name>
the last one is to show commit that made in to it a change for the file name.

git log -p
 This command shows all commits and the change that happen to files on it.
git log -p <commit-ID1>..<commit-ID2> <file-name>
 Show what happen to the <file-name> start from the <commit-ID1>.
git log --stat --summary
 show the static about the changes each commit
git log --graph --oneline --decorate --all
 show a nice represent !

Viewing commits:
git show <commit-ID>
This command check the commit and show all information about it !

Comparing Commits:
We going to see how to compare different status of the directory.
git diff <commit-ID>
 This command will show us the different between the directory in that commit and the current directory.
git diff <commit-ID> <file-name>
 This show only what happen to <file-name>.
git diff <commit-ID1>..<commit-ID2> <file-name>
 This will use a range.
git diff --stat --summary <commit-ID>..<HEAD>
 Summary of list that change in that range.

See the Git and Github Tutorials.




Oussama Amri 21 years, security professional from Tunisia. Lover of computer science especially programming and secuirty. Follow me On :

Popular Posts Powered by Blogger.