0

I'm trying to change my source control repository in VSCode, but I can't find any way to do it.

This happened because I was originally working on another project linked to this git repository, and then when I created a new expo app in a new folder, it seemed to be automatically linked to the old repository.

I saw some instructions online about adding a remote repository, but I was thinking that I wanted to change the source control repository rather than add a remote.

Currently I don't see any option to do this. Any help is appreciated, thanks!

Source Control Repository

Lloyd Rajoo
  • 137
  • 2
  • 13
  • What do you mean by "source control repository"? What are you expecting to happen? – evolutionxbox Dec 07 '22 at 16:00
  • 1
    Depends on what you want to accomplish; this sounds like it's as easy as just deleting your own `.git` folder, but there's nothing too specific about what it is your desired outcome needs to be. – Makoto Dec 07 '22 at 16:01
  • to clarify - I want to remove any link in this VS code project to the existing git repository , so that I can create a new git repository just for this VS code project. – Lloyd Rajoo Dec 07 '22 at 16:06
  • 1
    I'm assuming you cloned the repo from somewhere else. @Makoto is correct, if you do not want the current local repo, remove the `.git` folder, and start again – evolutionxbox Dec 07 '22 at 16:07
  • thanks both. is this the right command to run from my project in VSCode? rm -rf .git – Lloyd Rajoo Dec 07 '22 at 16:15
  • 2
    Let me be clear - are you *sure* that's what you want to do? Deleting the folder (especially from terminal) may not be reversible. Be *very* explicit about what your desired end state is. – Makoto Dec 07 '22 at 16:17
  • I don't want to remove my files in this project, but I want to link this project to a new git repository. – Lloyd Rajoo Dec 07 '22 at 16:18
  • 1
    So you're happy with keeping the existing history in this repository, but you want it to point to a different upstream location? Or do you want to have a clean slate of history instead? – Makoto Dec 07 '22 at 16:18
  • Please bear in mind that git is a _distributed_ version control system. The repo you'll be editing and interactive is _local_. – evolutionxbox Dec 07 '22 at 16:20
  • yes, the files in their current state are correct. It's just that I realized it's linked to an old git repository. so I want these files to point to a different repository – Lloyd Rajoo Dec 07 '22 at 16:20
  • if I do that, will it push the code from my existing project into that remote repository, or will it push the code from the remote repository into my project? – Lloyd Rajoo Dec 07 '22 at 16:25
  • You'll be pushing things into that remote repository. Or you could pull things down if you did `git pull`. I'm presuming that the new remote you want to interact with is clean and is suitable to push things into. Is that not the case? – Makoto Dec 07 '22 at 16:26

0 Answers0