Skip to content

Instantly share code, notes, and snippets.

@fernandoaleman
Last active January 8, 2025 09:51
Show Gist options
  • Save fernandoaleman/853916e1903b475820f5416bfe048cb8 to your computer and use it in GitHub Desktop.
Save fernandoaleman/853916e1903b475820f5416bfe048cb8 to your computer and use it in GitHub Desktop.
How to clone git repo with all branches and tags
# Clone repo
git clone --mirror [email protected]/fernandoaleman/app.git app/.git
# Change into app directory
cd app
# Update git config
git config --unset core.bare
# Checkout master branch
git checkout master
@buouyu
Copy link

buouyu commented Jun 10, 2021

caonima

@quant61
Copy link

quant61 commented Oct 18, 2021

thanks, but those branches don't track their remotes.

how to make them all track their remotes?

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