5 ms·git clone -b $tag $repo_urlby abdusco 4y agogit clone -b $tag $repo_urljunon 4y agoOr the longer way, if you're on a version of git without the -b option: git init ./repo cd ./repo git remote add origin $uri git fetch origin $tag git checkout FETCH_HEADlillecarl 4y agoOr what you would probably do using libgit(2?) :)