This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getCurrentGitBranch() { | |
def gitBranch = "Unknown branch" | |
def workingDir = new File("${project.projectDir}") | |
def result = 'git rev-parse --abbrev-ref HEAD'.execute(null, workingDir) | |
result.waitFor() | |
if (result.exitValue() == 0) gitBranch = result.text.trim() | |
return gitBranch | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git clone $1 --depth=1 | |
# cd into the repo directory | |
a=$1 | |
b="${a##*/}"; | |
cd "${b%.*}" | |
for i in {1..100000..10}; do git fetch --depth=$i; done | |
git fetch --unshallow |