27

I am trying to push my project files to my repository. But when I do that I get errors as in following screenshot.

Pushing files

I had a repository in that project file before and I deleted it. Now I have created another repository with a different name in that project file. But I get these errors now. Please tell me what I should do.

2

2 Answers 2

59

To update the origin to the new repository.

git remote set-url origin <new-url>

In your case, paste the command below if you updated your remote repo as per name suggested.

git remote set-url origin https://github.com/BSThisarasinghe/Sabra-Medical-Center.git 
Sign up to request clarification or add additional context in comments.

Comments

6

You need to update your remote settings.

First remove the old origin: git remote remove origin

Next, add the updated url: git remote add origin _new url_

After that, confirm everything looks good with git remote -v and you should be able to push again.

3 Comments

is it necessary to push some changes after set new origin..?
Yes, setting the origin won't push...you need to invoke the push command after setting the origin
Ok....thank you @jonathan Brink

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.