1

While setting up my project I had set up my repo in GitLab. Now I have migrated to GitHub by importing the repository. All the history (commits) has been imported successfully. But now when I add new commits, those are still shown in GitLab and not updated in GitHub. How do I link my project to GitHub and cut its ties with GitLab?

"repository": {
"type": "git",
"url": "git+https://gitlab.com/username/projectname.git"
},
"bugs": {
"url": "https://gitlab.com/username/projectname/issues"
},
 "homepage": "https://gitlab.com/username/projectname#readme"

This is how my package.json looks as of now

YB_6
  • 11
  • 3
  • What is the output of `git remote -v` ? – Jona Jun 26 '20 at 11:56
  • `origin https://gitlab.com/username/projectname.git (fetch)` `origin https://gitlab.com/username/projectname.git (push)` – YB_6 Jun 26 '20 at 11:59
  • The answer is there : https://stackoverflow.com/questions/2432764/how-to-change-the-uri-url-for-a-remote-git-repository – Jona Jun 26 '20 at 12:04

1 Answers1

-1

Vanilla git does not store the remote repository location in the package.json. Use this command to change the remote repository:

git remote set-url origin https://github.com/username/project.git

(You'll have to update the username and project)

Daly
  • 787
  • 2
  • 12
  • 23