I am using jgit api for my project's build, deployment functionalities (in Local Machine). I commited whole source (java project) via command prompt by following commands
git add .
git commit -a -m "Initial_Source"
Here I get the commit id as
cb96c685a5a4338f852a782631df8d1cf5dca21d
git tag Initial_Source cb96c685a5a4338f852a782631df8d1cf5dca21d
[cb96c685a5a4338f852a782631df8d1cf5dca21d is commitid]
git push
git push --tags
but when i tried to get commit id via getPeeledObjectId() it is returning null
my code is
Ref tag = git.getRepository().getRef("Initial_Source");
Ref peeledRef = git.getRepository().peel(tag);
return peeledRef.getPeeledObjectId(); -- this is returning null
but instead of getPeeledObjectId()
I tried using getObjectId()
. It's giving the commitId. But I wanna know when to use getPeelObjectId()
and getObjectId()
.
What are those methods?