git常用命令
2023-05-15 17:07 john_zhu_t 阅读(54) 评论(0) 收藏 举报-
View author names with commit count.
$ git shortlog -nse -
To get the particular user’s commit Git log, run the “git log” command with the “–author” parameter and its value:
$ git log --author=zhuliangshun -
git log command option: -p, -u, --patch #Generate patch (see section on generating patches)
--name-only #Show only names of changed files. -
see the difference for a file "main.c" between now and two commits back, here are three equivalent commands
$ git diff HEAD^^ HEAD main.c
$ git diff HEAD^^..HEAD -- main.c
$ git diff HEAD~2 HEAD -- main
git diff e16acac~ e16acac -
Retrieve a git repository for a .git file
$ git checkout . -
git a archive
$git archive --remote=ssh://x.x.x.x:xxxx/xxx.git branch dir1/dir2/xx/remote_file | tar -xO > local_file
Note: -xO means extract to standout
浙公网安备 33010602011771号