How to restore remote Git repo from a local copy

One way would be to re-initialize the remote repository completely cleanly and then do a push from local.

On the server, in the directory where the bare repository should live, do

git init --bare

On the client (local repo), set the new origin if it has changed, and push to the server, and set up tracking again.

git remote set-url origin <Remote_URL>
git push origin master
git branch --set-upstream-to=origin/master master

Sources

http://stackoverflow.com/questions/23397089/how-to-restore-git-bare-repository-from-local-one

Leave a Reply

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