I'll start by saying that I use git for source code control in Visual Studio Code, but have very little understanding about how it works beyond doing commits and restoring older versions.
I have developed an application in Flutter using Visual Studio Code, let's call this app
. I have realised that my design choices have not been great and my best option is now to build a new app top-down taking selected code from the old app, and addressing the bad design choices I have made as I go.
To start this process, I have renamed my old app to appold
following the guidance here, and then created a new Flutter project called app
(i.e. I have used the same name as the original version of my application) using flutter create app
at the command prompt.
When I open the new app
folder in Visual Studio Code, the source control function shows that I have several hundred unsaved changes, which are all the missing files from appold
(the new app
is an empty Flutter project).
If I open a command prompt, go into each project folder (app
or appold
) and enter the command git log
, I get the same output in each case, i.e. I get a list including all the stored changes to the original application.
Based on what I have read online, everything for git is stored in a .git folder in the project folder (i.e. it is a local database/repository), but what I am seeing suggests that there is a shared git database/repository somewhere and my re-use of the original application name for the new application is causing me problems.
I have looked at the answer here for renaming/moving a repository, but this doesn't seem to provide an answer to my particular problem, but that might be due to my lack of understanding.
I have gone into each of the .git folders and changed the entries in the description
files to contain the respective project names app
and appold
. This hasn't made any difference.
Probably also worth mentioning that, to the be best of my knowledge, I haven't uploaded any of my code to the internet, e.g. github. I have tried to avoid this because I do not want or need the code to be online. I have checked my github account online and can't see any of my app
changes in there.
Given my situation, how do I stop the new app
project seeing the repository for the old version of the application, but use a new, empty repository instead?