I need to fetch the files from just one specific branch. I have tried a couple of commands, but it ends up pulling the whole repo, instead of just the few files I need to pull to a directory from the specific branch.
git version 1.7.1
I need to fetch the files from just one specific branch. I have tried a couple of commands, but it ends up pulling the whole repo, instead of just the few files I need to pull to a directory from the specific branch.
git version 1.7.1
If you get an error on:
git clone git@bitbucket.org:name/name.git -b mv_LookbookAddition --single-branch
It means you need to 1.7.10+ (June 2012), using, for Linux, a ppa or git-scm.com/download/mac for Mac.
But you will get the full history of the branch (if that branch has been created from master
, you will get all the commits from master
, up until the branch starts, plus the branch commits)
You can try and combine the --depth option to get only the last commits from the branch alone
git clone git@bitbucket.org:name/name.git -b yourBranch --single-branch --depth 10
That will your cloned repo a shallow repo, which is why you want a git 2.0+ (because you can create commits and push back, from your shallow repo).
See explainshell.com.