[英]Git: Get a list of files/folder committed and pushed in crrent branch
[英]Get list of files to recently pushed to remote Git branch
如何获取最近使用Git推送到远程分支的文件列表? 还是有什么办法列出远程分支文件?
我用谷歌搜索,但没有得到建议。
以下是严格的命令行解决方案,它们不使用TortoiseGit GUI客户端。
要查看哪些文件已被推送到远程分支,只需从远程获取最新更改,然后使用git log --name-status
或git diff
获取自上次以来已更改/添加/删除的文件的列表。从远程获取更改。
git diff
$ git fetch origin
$ git diff origin/master@{1} origin/master --name-status
A hello.txt
请注意,仅当reflog中分支的条目超过1个时,才能在reflog语法<branch>@{n}
中使用diff
。 否则,您将收到此错误:
$ git diff origin/master@{1} origin/master --name-status
fatal: Log for 'origin/master' only has 1 entries.
git log
$ git log --oneline --graph --name-status origin/master@{1}..origin/master
* 6e6ce69 Add hello.txt
A hello.txt
同样,仅当引用日志中分支的条目超过1个时,才使用引用日志语法<branch>@{n}
。 如果您不介意查看分支的整个历史记录,则可以改用以下代码:
$ git log --oneline --graph --name-status
* 952e133 Add Bash alias for `pbcopy` (OS X)
| M osx/.bash_profile
* c843ea2 Set Vim column limit to 80 (OS X)
| M osx/.vimrc
* 320ed55 Add "Base16 Dark Tomorrow" Sublime Text theme (OS X)
| M editors/sublime-text/Preferences.sublime-settings
* ffff5a5 Add Bash configuration for Scala
| M osx/.bash_profile
* 1b7f496 Add alias for Dr Java to Bash config (OS X)
| M osx/.bash_profile
* 475593a Add global .gitignore file for OS X
| M osx/.gitconfig
| A osx/.global-gitignore
* 7668f34 Modify Bash config to use Homebrew recommended PATH
| M osx/.bash_profile
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.