Discover Git object hash based on path and branch

I’m writing a small web Git visualization tool and i wanted to convert a file path and a branch:

master repository/folder/test => a39bc19d82890f25df2d08d8bea627bb4354e8d8
mybranch repository/folder/test/ => 76e2242459d360f7429ed748426e660b6dacc9a9

Into a Git object hash, so i can properly use git show and git cat-file, as well git ls-tree. My app currently looks like this:

  • repo does not create a tracking branch but git clone does
  • git `merge --squash` does not add “Merge” header to commit
  • Tag messages on github
  • Git interactive rebase reword - commit position in history changed
  • git, ignore files with a pattern in Laravel
  • Netbeans Project from Mac to Windows
  • show.php?h=76e2242459d360f7429ed748426e660b6dacc9a9

    I want to convert paths into something more usable, like:


    Any ideas?

  • Is there any way to compare two files in Git without their formatting changes?
  • Why the branch that I am creating on Git does not appear?
  • How to prevent eslint from blocking git commit?
  • How to customize diff git to ignore yard date generation
  • OSX 10.10 yosemite beta on git pull: git-sh-setup: No such file or directory
  • Migrating from Subversion to Git how can I find a commit given a revision number?
  • One Solution collect form web for “Discover Git object hash based on path and branch”

    The branch:path notation was the solution. Thanks Noufal Ibrahim!

    Git Baby is a git and github fan, let's start git clone.