May 25

Pushing git branches to another repository

Leaving this here as I keep on forgetting these whenever I try to replicate a repository to a test repository:

git remote add new_repo git@gitprovider.com:/path/to/new-test-repo.git
git fetch --all --prune
git push --prune new_repo +refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/*

Tags:
Copyright 2021. All rights reserved.

Posted May 25, 2020 by admin in category "Work

Leave a Reply

Your email address will not be published. Required fields are marked *