Skip to content

Instantly share code, notes, and snippets.

@xconnecting
Created November 28, 2012 01:16
Gradle: git init through command line
ant.condition(property: "os", value: "windows") { os(family: "windows") }
ant.condition(property: "os", value: "unix" ) { os(family: "unix") }
task gitInit(type:Exec){
group = 'Git'
description = 'git init'
workingDir '.'
switch(ant.properties.os){
case 'windows':
commandLine 'cmd', '/c', 'git', 'init'
break
case 'unix':
commandLine 'git', 'init'
break
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment