General TC > General TC Talk

using git to get a specific branch...some info

(1/1)

aus9:
Hi

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


--- Code: ---git clone <url>
--- End code ---

recently I needed to download a specific branch of a git  so I looked for a simple way
my ref was
https://stackoverflow.com/questions/1911109/how-to-clone-a-specific-git-branch

first from that link I quote

--- 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>
--- End quote ---

This did not work for me. It was not re-testing that I found the method should IMHO have read

--- Code: ---git clone <repository_url>
cd <download-name>
git branch -a
git checkout <name_of_branch>
--- End code ---

but highest vote works better

--- Quote ---git clone -b <branch> <remote_repo>
--- End quote ---

hope that helps other newbie git users



Navigation

[0] Message Index

Go to full version