From what I'm compiling, it looks like you want to have several git repositories, each of which represents a project, deployed side by side in what seems like a web hosting directory.
From a little experiment (and confirmation by other answers) it seems that you created the git repository in htdocs , and one of them does not exist in htdocs/project . There may or may not be a git repository in htdocs/otherproject and htdocs/project3 .
Assuming that the current htdocs repository htdocs not have a commit history that you want to keep, you can safely delete the htdocs/.git and create new repositories in the htdocs/project and other project directories.
Otherwise, if you want to keep a commit history, you have to work a little. I'll start by backing up the htdocs directory, just in case. From there I will remove all subdirectories from htdocs except the htdocs/project directory and add these changes to the index. Then I moved the contents of the htdocs/project directory to the root of the repository (before htdocs ) and add these changes to the index. Finally, I would delete the htdocs/project directory, change the change, and commit. Please note: if there are files in the htdocs directory whose names are the same as in the htdocs/project directory, you can save some headaches by making an extra commit before moving the contents of the htdocs/project directory. From there, you can simply rename htdocs to project , create a new htdocs directory and move project to htdocs . Finally, simply move the backup project directories to the new htdocs directory.
source share