I've just created a new project in htdocs/project
and when I use a status to pick up the files in that folder it is listing the files and directories contained in htdocs/project
but it is also listing all the folders and children of htdocs
as well.
For example:
# Changes not staged for commit:
# modified: ../otherproject/index.php
# modified: ../project3/index.php
# Untracked files:
# ../otherproject/blah.txt
# ../project3/img/lol.jpg
If it helps I used the "Git Bash Here" option to change my Git directory to htdocs/project
.
Is 'htdocs' itself a git repo?
ls htdocs/.git
If so, that would explain what you're seeing - a git repo can't have another repo within it.
(Posted as an answer rather than a comment because I don't have enough persimmons.)
Edit: Based on the discussion below, this seems to be the problem. According to http://progit.org/book/ch6-4.html:
Making a Subdirectory the New Root
Suppose you’ve done an import from another source control system and have subdirectories
that make no sense (trunk, tags, and so on). If you want to make the trunk subdirectory be
the new project root for every commit, filter-branch can help you do that, too:
$ git filter-branch --subdirectory-filter trunk HEAD
Rewrite 856f0bf61e41a27326cdae8f09fe708d679f596f (12/12)
Ref 'refs/heads/master' was rewritten
Now your new project root is what was in the trunk subdirectory each time. Git will also
automatically remove commits that did not affect the subdirectory.
I haven't done this myself, so hopefully someone who has will volunteer some experiences.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With