lets say I have a commit Id "0678dd19c498ede50e7714505eb5af3a5494beef" I tried "git log" command, which prints,
$git log --full-history 1c57338cd62ee1a83df57d2c37ce1f3fa17bee17
commit 1c57338cd62ee1a83df57d2c37ce1f3fa17bee17
Author: [email protected]
Date: Thu Feb 3 15:39:33 2011 -0800
Updated ejo syntax
commit 8fb7a6b3e44a020e4e495fd1c9a9976c8675c339
Author: [email protected]
Date: Thu Feb 3 14:49:19 2011 -0800
Added a sample controller
commit 628788eb81c365a88ab435ffa62978077065f72c
Author: [email protected]
Date: Wed Feb 2 11:33:41 2011 -0800
Test checkin
Is there anyway to print the branch on which this commit is made?
Commit IDs are unique SHA-1 hashes that are created whenever a new commit is recorded. If you specify a commit ID when you add a repository, Domino will always pull the state of the repository specified by that commit in a detached HEAD state.
`git log` command is used to view the commit history and display the necessary information of the git repository. This command displays the latest git commits information in chronological order, and the last commit will be displayed first.
On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.
The command you want is
git branch --contains <commit>
Note that the commit may be contained in multiple branches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With