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? 回答1: Summary: You can use Git's reflog to show recent movements: git reflog Script: Here's a script you can download and use via git recent from inside any Git repository: https://gist.github.com/jordan-brough/48e2803c0ffa6dc2e0bd Details: Here's essentially what the script does to make the reflog output more usable: $ git reflog |