git 远程分支按时间排序_按日期对git分支进行排序

git 远程分支按时间排序

I'll be first person to admit I don't do as much git repository maintenance as I should.  I rarely delete branches which have been merged, so a git branch execution shows me a mile-long list of branches that likely aren't relevant.  The best way to find branches I've recently used is to use the following command:

我将是第一人称我不做应有的git仓库维护。 我很少删除已合并的git branch ,因此执行git branch向我显示一英里长的分支列表,这些列表可能与目标无关。 查找我最近使用过的分支的最佳方法是使用以下命令:


git for-each-ref --sort=-committerdate refs/heads/


The command above lists the most recently worked on branches from top to bottom.  If you want to see the date of last commit, you can do this:

上面的命令从上到下列出了分支上最近使用的命令。 如果要查看最后一次提交的日期,可以执行以下操作:


git for-each-ref --sort='-committerdate' --format='%(refname)%09%(committerdate)' refs/heads | sed -e 's-refs/heads/--'


I find these commands incredibly helpful when returning to work from a weekend or just jumping from project to project.  Hopefully you can use these commands too!

我发现从周末返回工作或从一个项目跳到另一个项目时,这些命令非常有用。 希望您也可以使用这些命令!

翻译自: https://davidwalsh.name/sort-git-branches

git 远程分支按时间排序

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值