Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What git branch was I just in?

Tags:

git

My workflow often consists of the following:

  • working on a long term feature branch (call it 'A')
  • checking out master and making a hotfix branch (call it 'B')
  • pushing my hotfix
  • Then I forget what branch I was working on before that...

Is there any sort of git history that will show me that the thing I was previously working on was branch A?

like image 495
Michael Arrison Avatar asked Jan 03 '23 16:01

Michael Arrison


1 Answers

Try:

git reflog

which will list all of your recent actions that changed something, so checkout, rebase, pull, push, etc.

Also it includes all the commit ids, so for example if you did a dozen commit --amend you can jump back to one in the middle.

like image 76
Duncan Avatar answered Jan 07 '23 16:01

Duncan