Skip to content

Instantly share code, notes, and snippets.

@ignaciotcrespo
Last active August 25, 2024 15:30
Show Gist options
  • Save ignaciotcrespo/02ecf59692849662f5b3 to your computer and use it in GitHub Desktop.
Save ignaciotcrespo/02ecf59692849662f5b3 to your computer and use it in GitHub Desktop.
git clone a specific branch, ONLY the latest commit without history, and wipe out folder before
# wipe out folder. Added manually the .git folders due to cant find a good command to delete everything in macos & linux
rm -rf .git
rm -rf .git*
rm -rf ./*
# clone branch, fast way to get a specific branch without the complete history
git clone -b ${BRANCH_TO_BUILD} --depth 1 --single-branch ${REPO_URL} .
@anovsiradj
Copy link

nice

@Ajithkumar2803
Copy link

git clone -b ${BRANCH_TO_BUILD} --depth 1 --single-branch ${REPO_URL}

nice one its working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment