Which git branch was I only on?
My workflow often consists of the following elements:
- works in a long term feature branch (call it "A")
- checking out the master and creating a patch branch (let's call it "B")
- pushing my fix
- Then I forget which branch I was working with before ...
Is there any git history that will show me that the thing I was working on before was branch A?
+3
source to share
4 answers
As stated by gitrevisions , the syntax @{-number}
refers to the branch marked back by the branch. This uses reflogs, specifically reflog for HEAD
; see Duncan's answer .
(In your specific example, you would like to @{-1}
. For, git checkout
you can shorten it like git checkout -
, but that only works for git checkout
.)
+2
source to share