Why when I checkout a new branch using Git and push this new branch to origin repo, the base commit ID is 0000000000000000000000000000000000000000?
I’m using update hook in Git to check if this push has been approved in Phabricator(By connecting to mysql). When I trying to use the second param as old commitID in update script, I always get 40
0000000000000000000000000000000000000000 when this reference(branch) was created by
git checkout -b master and not pushed before.
But I want to get the last commitID of master to demonstrate the starting point of this reference.
- Phabricator auto backup all diffusion to BitBucket
- How to know the branch name in an arcanist event
- Phabricator hosted repository returning error 500 on clone
- How do you integrate Phabricator and Git or SVN
- Phabricator git command not found
- Commits that have gone through Differential show up in Phabricator audit system
last commitID of my master branch is
I’m using master branch to checkout a new branch like this
git checkout -b t1
and then I code something and commit some times, so I got a new head of branch:
finally, I push this branch to origin using
git push origin t1
I expected to get the params of update script as below:
$1 refs/xxx/t1 $2 978881526a1be5dc49aeef93cd83679c2142eb60 $3 dfb3094b7e9f06a8bf49671b5bbab45dd5c4318e
but I got them as below:
$1 refs/xxx/t1 $2 0000000000000000000000000000000000000000 $3 dfb3094b7e9f06a8bf49671b5bbab45dd5c4318e
Does anyone know how to solve this problem?
One Solution collect form web for “Why when I checkout a new branch using Git and push this new branch to origin repo, the base commit ID is 0000000000000000000000000000000000000000?”
When no commit is in the repository, the old commit id is all zeros. This is the same for new branches, see also the explanations in Git receive/update hooks and new branches which recommends ways to get around this problem.