window下 请打开git bash窗口,因为linux命令有些需要用到
查找项目所有成员提交的情况统计
git shortlog -s -n
结果
(base) liuhaihua@liuhaihuadeMacBook-Pro springcloud-demo % git shortlog -s -n
60 liuhaihua
3 Harries
查找某人提交信息
git log --author="liuhaihua" --date=iso --pretty=format:’"%h","%an","%ad","%s"’
结果
(base) liuhaihua@liuhaihuadeMacBook-Pro springcloud-demo % git log --author="liuhaihua" --date=iso --pretty=format:’"%h","%an","%ad","%s"’
’353c676,liuhaihua,2025-01-03 21:02:49 +0800,spring cloud security’
’0be19bb,liuhaihua,2025-01-02 17:07:22 +0800, Spring Cloud security’
’c5d7c24,liuhaihua,2025-01-02 15:07:07 +0800, Spring Cloud security’
’645e007,liuhaihua,2025-01-02 14:56:09 +0800, Spring Cloud security’
’8910e22,liuhaihua,2024-12-26 18:14:31 +0800, Spring Cloud security’
’c619eee,liuhaihua,2024-12-25 18:01:56 +0800, Spring Cloud security’
’e4e2221,liuhaihua,2024-12-24 18:23:02 +0800, Spring Cloudsecurity’
’b5a6318,liuhaihua,2024-12-23 16:09:46 +0800, Spring Cloud openfeign’
’00a8985,liuhaihua,2024-12-05 10:41:10 +0800, Spring Cloud zooKeeper’
:
将结果导出Excel
git log --author="liuhaihua" --date=iso --pretty=format:’"%h","%an","%ad","%s"’ >> ~/Desktop/commit-liuhaihua.csv
查找某人修改的文件(去重)
git log --author=liuhaihua --name-only --pretty=format: --all | sort | uniq
结果
(base) liuhaihua@liuhaihuadeMacBook-Pro springcloud-demo % git log --author=liuhaihua --name-only --pretty=format: --all | sort | uniq
LeaderElection/docker/run.md
LeaderElection/pom.xml
LeaderElection/src/main/java/com/et/LeaderElectionApplication.java
LeaderElection/src/main/java/com/et/LeaderElectionConfig.java
LeaderElection/src/main/resources/application-node1.properties
LeaderElection/src/main/resources/application-node2.properties
README.md
Spring-Cloud-Function/pom.xml
Spring-Cloud-Fun
。。。。
按时间查询某人提交记录
git log --author=liuhaihua --since='2024-07-01' --until='2024-08-01' --no-merges --pretty=format:"%ad %s" --date=short | uniq | sort
结果
(base) liuhaihua@liuhaihuadeMacBook-Pro springcloud-demo % git log --author=liuhaihua --since='2024-07-01' --until='2024-08-01' --no-merges --pretty=format:"%ad %s" --date=short | uniq | sort
2024-07-16 Spring Cloud hystrix
2024-07-16 springcoud-with-eureka
查询用户在指定日期内提交的后缀名为 java 或 css 的文件
git log --author=liuhaihua --stat --no-merges --name-only --since='2024-01-20' --until='2024-12-31' | grep -E ".java|.css$" | sort | uniq
结果
(base) liuhaihua@liuhaihuadeMacBook-Pro springcloud-demo % git log --author=liuhaihua --stat --no-merges --name-only --since='2024-01-20' --until='2024-12-31' | grep -E ".java|.css$" | sort | uniq
LeaderElection/src/main/java/com/et/LeaderElectionApplication.java
LeaderElection/src/main/java/com/et/LeaderElectionConfig.java
Spring-Cloud-Function/src/main/java/com/et/DemoApplication.java
Spring-Cloud-Function/src/main/java/com/et/controller/FunctionController.java
Spring-Cloud-Function/src/main/java/com/et/function/CustomFunctions.java
。。。。