There are similar questions but not quite what I need.
I have this structure in several projects:
/var/www/proj-a/
app/
.git/
script-a.js
script-.js
... more files and directories
data/
... data and config files go here
I want to have the .git
folder directly in the project folder, not as a sub-directory of app
. But the repo will still only manage files in the app
directory. In other words, I will use .gitignore
to exclude everything inside the project directory except for the app
directory.
The new structure should look like this:
/var/www/proj-a/
.git/
app/
script-a.js
script-.js
... more files and directories
data/
... data and config files go here
.gitignore
Now, in git are paths saved as absolute paths allowing me to just move the .git
directory to the project directory without any issues; or are paths relative resulting in source files not being found? If the paths are relative, how can I achieve this change without loosing my git branches and history?