Ela
Ela

Reputation: 3402

Detached head - move to more recent commit

When in detached mode in git, it is easy to see the older commits with git log and so you can easily navigate to them. However how do you move to a more recent one?

Upvotes: 2

Views: 81

Answers (1)

VonC
VonC

Reputation: 1324318

You can list the branches that contain the commit referenced by the detached HEAD (say: <acommit>)

git branch --contains <acommit>

Any git log <acommit>..<abranch> would then list more recent commits.

Upvotes: 2

Related Questions