Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update origin after renaming the repository name

Tags:

git

github

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.

like image 228
Buwaneka Sudheera Avatar asked Jul 10 '17 12:07

Buwaneka Sudheera


People also ask

What happens if you change repository name?

You can rename a repository if you're either an organization owner or have admin permissions for the repository. When you rename a repository, all existing information, with the exception of project site URLs, is automatically redirected to the new name, including: Issues.

Can we change origin name in Git?

Conclusion. In this tutorial, you learnt how you can easily change your Git remote URL (commonly named origin) by using the “git remote set-url” command. You also learnt that you can change it using a password protected SSH address.

How do I change my Git repository in origin?

Run the git remote set-url --add --push origin git-repository-name command where git-repository-name is the URL and name of the Git repository where you want to host your code. This changes the push destination of origin to that Git repository.


1 Answers

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
like image 190
Den Isahac Avatar answered Sep 30 '22 01:09

Den Isahac