[英]Find files that have changed of current branch without being able to compare to another branch
My CI environment only has the branch being pushed. 我的CI环境只有分支被推送。 Is it possible to see all files that have changed since the creation of the branch without comparing it to another branch?
是否可以查看自创建分支以来已更改的所有文件,而无需将其与另一个分支进行比较?
I found multiple examples comparing branches, but nothing that worked when only one branch is available. 我发现有多个比较分支的示例,但是当只有一个分支可用时,没有任何效果。
I'm trying to think outside the box, like number of commits with the branch name then get that many commits from the log like such where -n would be the number of commits: 我试图在框外思考,例如具有分支名称的提交数量,然后从日志中获取大量提交,例如-n将是提交数量:
git log --name-only --pretty=format: -n 5 | sed '/^$/d' | uniq
but I cannot find a way to get the correct number of commits 但是我找不到一种方法来获取正确的提交数量
/mnt/c/git/ConsoleApp1 (master)>git log --name-only --oneline --pretty=format: | sort | uniq
ConsoleApp1/Class1.cs
ConsoleApp1/ConsoleApp1.csproj
ConsoleApp1/Program.cs
ConsoleApp1.sln
.gitignore
x.txt
z.txt
git rev-list
or git log
git rev-list
或git log
git diff-tree git diff树
C:\\git\\ConsoleApp1>git diff-tree --no-commit-id --name-only -r 2f6e395..HEAD ConsoleApp1/Class1.cs x.txt z.txt
git rev-list
or git log
git rev-list
或git log
git show
- please note that git show is a porcelain command and it's not meant for scripting git show
请注意,git show是一个瓷器命令,并非用于编写脚本
C:\\git\\ConsoleApp1>git show --name-only --pretty="" -r 2f6e395..HEAD && git show --name-only --pretty="" -r 2f6e395 z.txt x.txt ConsoleApp1/Class1.cs .gitignore ConsoleApp1.sln ConsoleApp1/ConsoleApp1.csproj ConsoleApp1/Program.cs
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.