-1

I had a vscode project - folder with django and react, frontend and backend are the 2 folders.

\djangoshop
  \frontend #git was done here and uploaded to github
  \backend

Now after i m starting to do some work in backend folder i somehow need to track it too. But git init was done only in frontend initially. how to rehash it so i can commit and it will track backend folder too?

so when i do commits, it will also track and upload changes happening in both folders?

ERJAN
  • 23,696
  • 23
  • 72
  • 146
  • 1
    Does this answer your question? [Move Git repository up 3 levels from current folder, preserving history and adding new files](https://stackoverflow.com/questions/35703385/move-git-repository-up-3-levels-from-current-folder-preserving-history-and-addi) – AD7six Nov 26 '22 at 23:24

1 Answers1

2

You have a hidden folder named .git where you did your init, frontend in your case. Move the .git folder and .gitignore file to your top-level folder, djangoshop.

You may have a large number of changes and you won't keep change history for files in frontend prior to this point. When looking at your diff, files in the frontend folder will appear deleted and recreated.

geekTechnique
  • 850
  • 1
  • 11
  • 38
  • 1
    It’ll make more git-sense to `git mv` everything already committed to `djangoshop/frontend/frontend` move `djsngoshop/backend` to `djangoshop/frontend/backend` and then do what’s in the answer. Irrespective though, the result should be a move and history is maintained. – AD7six Nov 26 '22 at 23:22