$ echo 'hello world!!!'> newfile $ git-add newfile
$ git-status newfile # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: newfile #
$ git-commit -m 'add a new file' newfile Created initial commit f6fda79: add a new file 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 newfile
$ git-show commit f6fda79f2f550ea3b2c1b483371ed5d12499ac35 Author: chen <openunix@163.com> Date: Sat Nov 1 08:50:45 2008 -0400 add a new file diff --git a/newfile b/newfile new file mode 100644 index 0000000..b659464 --- /dev/null +++ b/newfile @@ -0,0 +1 @@ +hello world!!!
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ai) %C(bold blue)<%an>%Creset' --abbrev-commit
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。