Batch file script to download (clone) a specific branch from Git

We are using GitLab, an open source way to store source code on your own servers. I wanted to get all my branches into a clean directory, then recompile them to make sure everything had been checked-in properly. THe first step is to download all the branches into a directory.

NOTE: Apparently the –single-branch option did not exist in previous versions of Git.

cd \GitRecompile
git clone --single-branch -b myBranchName
git clone --single-branch -b myBranchName 
git clone --single-branch -b myBranchName

Leave a Reply

Recent Posts




All Rights Reserved Theme by 404 THEME.