I was working on a branch. But one of the contributors deleted the remote version of the branch. So, I now have a local copy of the code but no remote branch to push to. How do I recreate the remote version?
1 Answer
First, check to see if the old remote is still in your list:
git remote -v If it is, and you want to delete it, you do:
git remote rm [remote-name] ... for example.
Now create a new "remote" with the URL of the new repository host:
git remote add origin [https://github.com/user/repo.git] Then to push your local branches up to it:
git push --all -u (Replace all the stuff in brackets with the correct info for your repository.)