Created
June 14, 2018 05:46
-
-
Save zhangyoufu/ed93fd60c88efb91f6c4624a407f2bc5 to your computer and use it in GitHub Desktop.
shallow clone commits from branch point to tip of master/release branch, with tags
This file contains hidden or 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/sh | |
| git clone --shallow-exclude=release-branch.go1.10 https://github.com/golang/go.git | |
| cd go | |
| git remote set-branches --add origin release-branch.go1.10 | |
| git fetch --shallow-exclude=master origin release-branch.go1.10 | |
| git checkout release-branch.go1.10 | |
| git fetch origin $(git ls-remote --tags origin | awk '{print "git show "$1" &>/dev/null && echo +"$2":"$2}' | sh) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment