Reputation: 7699
Just cloned a git repo which has (besides the master branch) a lot of development branches. How can I tell which branch it was that the latest change was made to?
Most elegantly of course.
Upvotes: 2
Views: 80
Reputation: 410562
You can get all commits by running git log --all
. The first should be the latest commit. So you can list the branches that contain that commit with:
$ git branch --contains $(git log --oneline --all | cut -d ' ' -f 1 | head -n 1)
Upvotes: 1