0

I am writing a pre-receive hook. My remote branch doesn't have any commits yet. My local branch has several commits.

In the hook, I am not able to get all the commits from empty branch until recent commits. I tried git rev-list <recent-commit> git rev-list 4b825d..<recent-commit>

as per link (line #32).

l a s
  • 3,836
  • 10
  • 42
  • 61
  • Line 32 in your link reads, in its entirety, `remote_sha=4b825dc642cb6eb9a060e54bf8d69288fbee4904; # hash of the empty tree` (there is no occurrence of `git rev-list` here). That aside, in Git there is no such thing as an empty branch, so your question makes no sense to me. – torek Sep 09 '16 at 23:20
  • Am referring to empty tree. I am using github and there's no such thing like "4b825dc642cb6eb9a060e54bf8d69288fbee4904" as per https://github.com/gitpython-developers/GitPython/issues/355. – l a s Sep 09 '16 at 23:35
  • Ah, that makes a bit more sense. But the empty *tree* is not a branch, and is not a commit: it's a *tree*. See http://stackoverflow.com/q/9765453/1256452 for details. Since it is not a commit it cannot be used with `git rev-list`. – torek Sep 09 '16 at 23:46

0 Answers0