-
-
Save Vinatorul/f672991e3cca8a8d81dfc747bfb850b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# go to your repository | |
cd my_project | |
# check your existing remote | |
git remote -v | |
# origin [email protected]:my_project.git (fetch) | |
# origin [email protected]:my_project.git (push) | |
# Add a new remote, a github.com private repository for example | |
# the --mirror flag is what's different from a simple new remote | |
git remote add github --mirror [email protected]:Openhood/my_project.git | |
# Check the new remote | |
git remote -v | |
# github [email protected]:Openhood/my_project.git (fetch) | |
# github [email protected]:Openhood/my_project.git (push) | |
# origin [email protected]:my_project.git (fetch) | |
# origin [email protected]:my_project.git (push) | |
# To discover the difference check you .git/config | |
# the new remote has the config mirror = true | |
cat .git/config | |
# ... file start skipped ... | |
# [remote "github"] | |
# url = [email protected]:Openhood/my_project.git | |
# fetch = +refs/*:refs/* | |
# mirror = true | |
# Now all you have to do to mirror your entire repository is | |
git push github |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment