Answers for "git clone release"

0

git clone latest release

You can do this with the --branch flag, which will also accept a tag.

$ git clone  [email protected]:mygitname/theproject.git --branch 1.0.2
In most cases, you will just want to checkout the tag as described in Exprator's answer.
Posted by: Guest on March-05-2021
0

git clone release

# One-liner to get link to the source archive of latest release

curl -s https://github.com/USER/REPO/releases | 
    grep -m1 -Eo "archive/refs/tags/[^/]+\.tar\.gz" | 
        xargs printf "https://github.com/USER/REPO/%s"

# Command to clone the source of latest release to the current folder 
# w/o downloading archive to local disk

ghRepoCloneLatestRelease ()
{
    [[ ${1} =~ / ]] &&
        wget -qO- https://github.com/${1}/$(curl -s https://github.com/${1}/releases |
            grep -m1 -Eo "archive/refs/tags/[^/]+\.tar\.gz") |
                tar --strip-components=1 -xzv >/dev/null
}

# Usage: ghRepoCloneLatestRelease user/repo
Posted by: Guest on April-01-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language