I am trying to execute git command in my build.gradle file as shown below
println '===============>'
if (!branch){
// For local build
def proc = "git rev-parse --abbrev-ref HEAD".execute()
proc.in.eachLine {line -> println "===>$line"}
proc.err.eachLine {line -> println '===>ERROR: ' + line}
proc.waitFor()
}
println '<==============='
On execution it gives the below error:
===============>
===>ERROR: fatal: not a git repository (or any of the parent direc[![enter image description here][1]][1]tories): .git
<===============
When I tried to check the files/folders via ls -a I can see the .git folder
