Skip to content

Instantly share code, notes, and snippets.

@joe-oli
Created January 3, 2024 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joe-oli/61a7c91e2bcc50243b648f6ea8619c0f to your computer and use it in GitHub Desktop.
Save joe-oli/61a7c91e2bcc50243b648f6ea8619c0f to your computer and use it in GitHub Desktop.
Git Clone Single Branch Only
# change to the folder where you want to create newBranchName
git clone --single-branch --branch features/upgrade ^
C:\Projects\DevOps\MyRepoName newBranchName
# C:\Projects\DevOps\MyRepoName is the repo where the branch you want to clone resides in;
# newBranchName is relative to current folder;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment