Reputation: 1208
So I happened to work on this project that existed within a 'framework' and made a git repo for just the project and not within the framework. I had to modify a bunch of files in the framework and now I want to move my .git folder multiple levels up. I am not entirely sure how to do this. My project within the framework looks like this:
Framework/
|-A/
|-B/
|-C/
|-my_project/
|-.git/
Is there a way to move my .git to the top level (to Framework/) while preserving my git history?
Upvotes: 0
Views: 64
Reputation: 6058
You can move the .git
directory, however your current files will show as moved and you will need to add the other directory.
This will preserve your history, but this commit could be confusing in the future.
mv ./A/B/C/.git ./
git add .
git status
git commit -m "Move git root directory"
git push
Upvotes: 1