Pull specific branch from git Pull specific branch from git git git

Pull specific branch from git


Try:

git clone git@bitbucket.org:project/project.git -b develop_one --single-branch

For already cloned repos use:

git fetchgit checkout develop_one# Or more specific:git checkout --track -b develop_one

This will track the develop_one branch from the remote.


Also, to add to @tomrbrujin 's answer, you can specify the name of the local destination directory in the clone command like this:

git clone https://github.com/example/example1.git -b branch_name --single-branch local_name

The final arg passed, local_name would create and name the local copy of the cloned remote directory "local_name."

Otherwise, the local directory name will only reflect the repo name, which here would be: example