问题
I want to add a NopCommerce solution to a repository using git.
I entered in the folder where the .sln file is stored and used the git add . command
.
After that I ran the git commit --dry-run and the output was a little odd, this is the output:
new file: Nop.Web
new file: Nop.Web.Framework/.gitignore
The nop.web
folder was somehow detected, but the content wasn't. Its sibling was detected and all its files were uploaded successfully.
If I go to the nop.web
folder and use a git add .
or anything, and after use the git commit --dry-run
I get a "clean repo" message.
If I perform the push, when I try to build this project in appharbor, the files in the nop.web folder are missing.
Why is this folder missing? How can I add it manually?
Edit: .gitignore from AppHarbor FAQ:
[Bb]in
[Oo]bj
*.suo
*.user
There is a .gitignore in folder that contains a .csproj file. They are all the same
Edit2:
D:\nopcommerce\Presentation\Nop.Web>git ls-files --exclude-standard -o
D:\nopcommerce\Presentation\Nop.Web>git diff-index --name-status HEAD
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tr
ee.
Use '--' to separate paths from revisions
That was something interesting I found:
D:\nopcommerce\Presentation\Nop.Web>git add ./Administration
fatal: Path 'Presentation/Nop.Web/Administration' is in submodule 'Presentation/
Nop.Web'
I will try to look for infos about submodules and how to deal with them
回答1:
I see the there is a .gitignore
file added to your repository under that framework. Make sure that it isn't telling git to ignore everything in the folder that you are trying to add.
来源:https://stackoverflow.com/questions/14859952/git-add-is-not-adding-the-current-folder-to-repo