Skip to content

Instantly share code, notes, and snippets.

View HoldYourWaffle's full-sized avatar
💭
I may be slow to respond.

Ravi van Rooijen HoldYourWaffle

💭
I may be slow to respond.
View GitHub Profile
@HoldYourWaffle
HoldYourWaffle / current-git-branch.gradle
Last active February 16, 2018 18:34 — forked from lordcodes/current-git-branch.gradle
Gradle function to get the current git branch
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
}
@HoldYourWaffle
HoldYourWaffle / git-clone-large
Last active August 13, 2019 08:48
Git-clone a huge repository
#!/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