Tuesday, November 3, 2015

Git Made Easy - Part 3

When we want to push any branch, we need to get log files. There are 3 ways to get log files. They are --
1.  git log
2.  git log –stat
3.  git log –oneline

$ git log
commit 2297ac77d75a57aa1760e2e7560fe331e832a644
Author: Rizvi <abu.rizvi@rgroup.com>
Date:   Tue Nov 3 14:37:24 2015 +0600

    Some changes#1

commit 78d5c1ba8efef0ee6c715ab957a1a7a2ae65b3ef
Author: Rizvi <abu.rizvi@rgroup.com>
Date:   Tue Nov 3 13:39:46 2015 +0600

    .gitignore added

Description: “git log” gives commit number, author name, commit date and commit message.

$ git log --stat
commit 2297ac77d75a57aa1760e2e7560fe331e832a644
Author: Rizvi <abu.rizvi@rgroup.com>
Date:   Tue Nov 3 14:37:24 2015 +0600

    Some changes#1

 src/org/generics/MaximumTest.java | 57 +++++++++++++++++++--------------------
 src/org/generics/Test.java        |  9 +++++++
 2 files changed, 36 insertions(+), 30 deletions(-)

Description: “git log --stat” gives commit number, author name, commit date, commit message, name of classes which are changed and number of files.

$ git log --oneline
2297ac7 Some changes#1
78d5c1b .gitignore added
1987f90 Generics features added
b3e47f6 Thread Class newly added
63b4126 Merge pull request #3 from rizvi/br1005#ext

Description: “git log --stat” gives commit numbers and commit messages.

N.B.: If you amend, then git force push.
Scenerio: First br2009 is pushed to master
$ git push origin br2009:master
Then I have not created any branch and worked on same branch br2009. I amend the new code and then push forcibly makes success.

$ git push origin br2009:master  -f

No comments:

Post a Comment