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?

1

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.