Get current git revision programmatically
Answered
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.
Please sign in to leave a comment.
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