-5

I've seen the following:

git cat-file -p master^

I'm curios as to what the ^ character following the branch name means? If I put it without this character like this:

git cat-file -p master

It points to the commit specified inside master reference.

Max Koretskyi
  • 101,079
  • 60
  • 333
  • 488
  • 1
    The man page for nearly every command that accepts one or more commits as an argument refers you to the `gitrevisions` man page, which documents the trailing `^` character. – chepner Dec 16 '14 at 19:16
  • possible duplicate of [What does the caret (^) character mean?](http://stackoverflow.com/questions/1955985/what-does-the-caret-character-mean) – Andrew C Dec 16 '14 at 20:20

1 Answers1

0

That's an ancestry reference and means "the commit before the one that is pointed by master", i.e. its parent.

Stefano Sanfilippo
  • 32,265
  • 7
  • 79
  • 80
  • 2
    The ~ also does the same, but counts the number of generations of ancestors, rather than ^ which is the n-th step-parent for merges. – Philip Oakley Dec 16 '14 at 23:58