Git Repository:
To initialize the project. Git start tracking the changes.
[root@mytest ~]# mkdir /root/amit
[root@mytest ~]# cd /root/amit
[root@mytest amit]# git init
Initialized empty Git repository in /root/amit/.git/
Make changes,add changes and commit changes
[root@mytest amit]# ls -la
total 12
drwxr-xr-x. 3 root root 4096 Oct 19 04:49 .
dr-xr-xr-x. 9 root root 4096 Oct 19 04:49 ..
drwxr-xr-x. 7 root root 4096 Oct 19 04:49 .git
[root@mytest amit]# ls -la .git
total 40
drwxr-xr-x. 7 root root 4096 Oct 19 04:49 .
drwxr-xr-x. 3 root root 4096 Oct 19 04:49 ..
drwxr-xr-x. 2 root root 4096 Oct 19 04:49 branches
-rw-r–r–. 1 root root 92 Oct 19 04:49 config
-rw-r–r–. 1 root root 73 Oct 19 04:49 description
-rw-r–r–. 1 root root 23 Oct 19 04:49 HEAD
drwxr-xr-x. 2 root root 4096 Oct 19 04:49 hooks
drwxr-xr-x. 2 root root 4096 Oct 19 04:49 info
drwxr-xr-x. 4 root root 4096 Oct 19 04:49 objects
drwxr-xr-x. 4 root root 4096 Oct 19 04:49 refs
[root@mytest amit]# git add .
[root@mytest amit]# git commit -m “First Commit”
[master (root-commit) 609a623] First Commit
Committer: Amit <amit@openwriteup.com>
1 files changed, 2 insertions(+), 0 deletions(-)
create mode 100644 test.sh
Writing commit messges:
[root@mytest amit]# git log
commit 609a623c90c643377b12810e5efb1d789a4bdf81
Author: Amit <amit@openwriteup.com>
Date: Mon Oct 19 04:56:05 2015 -0400
First Commit
Shows no of commit:
git log -n 1
commit 609a623c90c643377b12810e5efb1d789a4bdf81
Author: Amit <amit@openwriteup.com>
Date: Mon Oct 19 04:56:05 2015 -0400
First Commit
until and since keyword in Git log
[root@mytest amit]# git log –since=2015-10-19
[root@mytest amit]# git log –since=2015-10-18
commit 609a623c90c643377b12810e5efb1d789a4bdf81
Author: Amit <amit@openwriteup.com>
Date: Mon Oct 19 04:56:05 2015 -0400
First Commit
[root@mytest amit]# git log –until=2015-10-18
[root@mytest amit]# git log –until=2015-10-19
commit 609a623c90c643377b12810e5efb1d789a4bdf81
Author: Amit <amit@openwriteup.com>
Date: Mon Oct 19 04:56:05 2015 -0400
First Commit
Check author name using git
[root@mytest amit]# git log –author=”Amit”
commit 609a623c90c643377b12810e5efb1d789a4bdf81
Author: Amit <amit@openwriteup.com>
Date: Mon Oct 19 04:56:05 2015 -0400
First Commit