Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
git:上次提交的是哪个远程git分支?_Git - Fatal编程技术网

git:上次提交的是哪个远程git分支?

git:上次提交的是哪个远程git分支?,git,Git,我试图找出最近更新的远程分支。类似“git show ref”的东西,但按时间顺序就足够了。我该怎么做呢?来点bash脚本怎么样 >> git show-ref | while read sha1 ref; do echo $(git log --pretty=format:%ai -1 $sha1) $ref ; done | sort 2010-10-23 15:30:57 +0200 refs/remotes/mambo/mambo 2010-10-23 15:30:57 +0

我试图找出最近更新的远程分支。类似“git show ref”的东西,但按时间顺序就足够了。我该怎么做呢?

来点bash脚本怎么样

>> git show-ref | while read sha1 ref; do echo $(git log --pretty=format:%ai -1 $sha1) $ref ; done | sort
2010-10-23 15:30:57 +0200 refs/remotes/mambo/mambo
2010-10-23 15:30:57 +0200 refs/remotes/mambo/master
2010-10-29 22:38:23 +0200 refs/heads/master
2010-10-29 22:38:23 +0200 refs/remotes/nas/HEAD
2010-10-29 22:38:23 +0200 refs/remotes/nas/master

此外,如果您有GUI,您可以使用
gitk
来观察GUI中的所有分支

使用,例如:

每个引用$git——格式='%(提交者日期)%09%(引用名称)'\ --排序=-committerdate引用/远程/ 2010-10-21 21:50:30+0200参考文献/remotes/git/trast/t/doc-config-extraction-v2 2010-09-23 17:40:05-0700参考文献/remotes/gitweb-kernel.org/master 2010-07-16 11:49:38+0530参考文献/遥控器/gsoc2010/gitweb write/master 2010-06-13 21:02:44-0700参考/远程/gsoc2010/gitweb write/next 2010-06-08 05:54:00+0000参考/遥控/gsoc2010/gitweb write/man 2010-06-08 05:53:58+0000参考文献/遥控器/gsoc2010/gitweb write/html 2010-06-07 22:16:45-0700参考文献/遥控器/gsoc2010/gitweb write/pu 2010-06-07 15:50:21-0700参考文献/遥控器/gsoc2010/gitweb写入/维护 2010-06-02 16:16:06-0700参考文献/遥控器/gsoc2010/gitweb写入/todo 2010-01-13 17:06:29-0800参考文献/remotes/gitweb-kernel.org/gitweb-ml-v5
我认为雅库布的答案比我的好。如果您不需要bash脚本的额外灵活性,我更喜欢内置解决方案。 $ git for-each-ref --format='%(committerdate)%09%(refname)' \ --sort=-committerdate refs/remotes/ 2010-10-21 21:50:30 +0200 refs/remotes/git/trast/t/doc-config-extraction-v2 2010-09-23 17:40:05 -0700 refs/remotes/gitweb-kernel.org/master 2010-07-16 11:49:38 +0530 refs/remotes/gsoc2010/gitweb-write/master 2010-06-13 21:02:44 -0700 refs/remotes/gsoc2010/gitweb-write/next 2010-06-08 05:54:00 +0000 refs/remotes/gsoc2010/gitweb-write/man 2010-06-08 05:53:58 +0000 refs/remotes/gsoc2010/gitweb-write/html 2010-06-07 22:16:45 -0700 refs/remotes/gsoc2010/gitweb-write/pu 2010-06-07 15:50:21 -0700 refs/remotes/gsoc2010/gitweb-write/maint 2010-06-02 16:16:06 -0700 refs/remotes/gsoc2010/gitweb-write/todo 2010-01-13 17:06:29 -0800 refs/remotes/gitweb-kernel.org/gitweb-ml-v5