How can I get a list of git branches that I've recently checked out?
When moving between git branches I sometimes forget the name of a branch I was recently on. How can I display a list of recently checked out branches/tags/commits?
Summary:
You can use git's reflog to show recent movement: git reflog
Script:
Here's a script you can download and use via git recent
from inside any git repo: https://gist.github.com/jordan-brough/48e2803c0ffa6dc2e0bd
Details:
Here's essentially what the script does to make the reflog output more usable:
$ git reflog | egrep -io "moving from ([^[:space:]]+)" | awk '{ print $3 }' | awk ' !x[$0]++' | head -n5
master
stable
fix-stuff
some-cool-feature
feature/improve-everything
链接地址: http://www.djcxy.com/p/26668.html
上一篇: 如何在Jquery脚本上定义一个子元素