不会将当前文件夹添加到回购

不会将当前文件夹添加到回购

本文介绍了Git添加。不会将当前文件夹添加到回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用git将NopCommerce解决方案添加到存储库中。

我输入存储.sln文件的文件夹并使用 git add。命令。

之后,我运行了git commit --dry-run,输出结果有点奇怪,这是输出结果:

nop.web 文件夹以某种方式被检测到,但内容不是。检测到它的兄弟姐妹,并成功上传了所有文件。



如果我转到 nop.web 文件夹并使用 git add。或任何东西,并在使用 git commit --dry-run 之后,我得到一个clean repo消息。

如果我执行推送,当我尝试在appharbor中构建此项目时,nop.web文件夹中的文件丢失。



为什么这个文件夹丢失?
$ b

编辑:AppHarbor的.gitignore在
[Oo] bj
* .suo
* .user

$ b中的c $ c> [Bb]
$ b

包含.csproj文件的.gitignore文件夹中。他们都是一样的



Edit2:

  D:\ nopcommerce \Presentation\Nop.Web> git ls-files --exclude-standard -o 

D:\ nopcommerce\Presentation\Nop.Web> git diff-index --name -status HEAD
致命的:模棱两可的参数'HEAD':未知的版本或路径不在工作tr
ee中。
使用' - '分隔修订版本的路径

我发现这很有趣:

  D:\ nopcommerce\Presentation\Nop.Web> git add ./Administration 
fatal:Path 'Presentation / Nop.Web / Administration'位于子模块'Presentation /
Nop.Web'中

我会尝试寻找有关子模块的信息以及如何处理它们。

解决方案

我看到有一个 .gitignore 在该框架下添加到您的存储库中的文件。确保它不告诉git忽略您尝试添加的文件夹中的所有内容。


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:

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

解决方案

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.

这篇关于Git添加。不会将当前文件夹添加到回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 14:22