0

I'm working on a React project in VS Code and am trying to push all of my files to a new Git web URL. The reason for this is because I changed the name of the repository causing the web URL to change as well. All of the changes I just commited from my project were pushed to the OLD URL, but I need to commit them to the new one. But since I have no unchanged files, I cannot push them from within VS Code studio.

Is there a way to commit my entire project to my repository through my new web URL despite not having any new changes that were made to any of my files?

Laurel Link
  • 195
  • 1
  • 4
  • 15
  • Git is completely decentralized, so your local clone contains everything already. You can just [change the URL of `origin` and push again](https://stackoverflow.com/questions/42830557/git-remote-add-origin-vs-remote-set-url-origin/42830632). – Tholle Mar 16 '19 at 16:51
  • 1
    Git doesn't push files. Git pushes *commits*. You connect your Git to some other Git, offer it some commit(s), and ask that it set some name(s) to remember those commit(s). They either already have the commits and don't need yours, or they don't have the commits and take yours in. Then they inspect the name-change requests ("set your `master` to hash ID `a123456` for instance) and either accept or reject that. Hence, @Tholle is correct: just `git push` to the appropriate URL. – torek Mar 16 '19 at 19:45

1 Answers1

0

I guess yo are talking about an old repo and a new repo when you talk about URLs, right? If that's the case, just add a new remote to that (local) repo with the URL to the new repo and push whatever branches you want into the new repo.

eftshift0
  • 26,375
  • 3
  • 36
  • 60