Get current git revision programmatically
已回答
Hello,
I am trying to get the current git revision programmatically. I checked this post https://intellij-support.jetbrains.com/hc/en-us/community/posts/206127699-Rigth-way-to-get-current-file-revision-git-?input_string=Get%20current%20git%20revision but I am not getting the revision.
Is there a sample code I could use to get the current project revision?
Thanks.
请先登录再写评论。
Got my answer, will publish for visibility and help other people that may have the same questions.
Add dependency in build.gradle:
intellij {...
plugins 'git4idea'
}
To do this in the code