0

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?

rrrocky
  • 696
  • 1
  • 11
  • 27
  • 1
    possible duplicate of [git push to remote branch](http://stackoverflow.com/questions/6279082/git-push-to-remote-branch) – jas_raj Jan 30 '15 at 16:26

1 Answers1

2

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.)

G33kGurl
  • 46
  • 4