WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: using git to get a specific branch...some info  (Read 808 times)


  • Guest
using git to get a specific branch...some info
« on: July 29, 2018, 06:15:41 AM »

my skills with git have been limited to either using a script to download the zip from various git repos or

Code: [Select]
git clone <url>
recently I needed to download a specific branch of a git  so I looked for a simple way
my ref was

first from that link I quote
Here is a really simple way to do it
Clone the repository....git clone <repository_url>
List all branches...........git branch -a
Checkout the branch that you want.....git checkout <name_of_branch>

This did not work for me. It was not re-testing that I found the method should IMHO have read
Code: [Select]
git clone <repository_url>
cd <download-name>
git branch -a
git checkout <name_of_branch>

but highest vote works better
git clone -b <branch> <remote_repo>

hope that helps other newbie git users