View submitted code records

Introduce several parameters , Combined with redirection, the problems caused by location submission are analyzed

parameter :

-n    Displays the date closest to the current point in time N strip

$git log  -n              Show recent N Article submission record , Submitter ,hash value , Description notes , Time and other information

--since                   From the current time node , Forward extrapolation n All submission records within days , That is, recently n Submission record of days

$git log --since=2.days    // Submission records of the last two days

--author                  Find all submissions from specific developers

$ git log --author=yanglin    // lookup yanglin Submission of

--grep=xxx             Find with keyword xxx All submissions

$ git log --grep=init     // use grep Find location , contain init All submissions

It can also be used git log | grep "init" Find containing init All submissions

git It works well in combination with redirection , combination tee instructions ( Original text redirection )
Find recent n Submission of
$git log -n | tee > git_n_commit.log

Find developers :yanglin Submitted code
$git log --author=yanglin | tee  > yanglin_commit.log

Find developers :yanglin lately 10 Submission of
$git log -10 --author=yanglin  | tee  > yanglin_n_commit.log

Find developers :yanglin lately 10 Submission within days
$git log --since=10.day  --author=yanglin  | tee >
yanglin_near_10day_commit.log

 

View data after a certain point in time log

git log --since="Fri Aug 10 19:16:10 2012 +0800" 
Or use --until View data before a point in time log

git log --before="Fri Aug 10 19:16:10 2012 +0800" 
Get the data after a certain point in time commit,-n 1 Indicates that only one is returned , The latest one

git rev-list -n 2  --since="Fri Aug 10 19:16:10 2012 +0800" yourbranch
Get the data before a certain point in time commit,-n 1 Indicates that only one is returned , The latest one youbranch Is the corresponding branch name

git rev-list -n 2  --before="Fri Aug 10 19:16:10 2012 +0800" yourbranch
Synchronize code before a point in time , Can be used to trace validation issues

repo forall -c "git checkout `git rev-list -n 1 --before=\"Fri Jun 29 15:53:40
2012 +0800\" yourbranch`"

 

Technology