Git add . is not adding the current folder to repo

坚强是说给别人听的谎言 提交于 2019-12-11 06:33:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!