为了调试第三方库中的问题,我将他们的源代码复制到我自己的git仓库中.我立刻重现了这个问题所以想要记录一个起点.当我尝试提交时,我复制的所有文件都没有显示在我的工作树中,因此我无法进行分级.
我尝试在复制的源中显式暂存其中一个文件:
git add README
fatal: Path 'Src/Foo/README' is in submodule 'Src/Foo/FooBar'
Run Code Online (Sandbox Code Playgroud)
所以似乎git认为它是一个子模块,尽管我从来没有告诉过它.我尝试删除第三方源的根目录中的.git目录,但这没有帮助.然后我尝试按照这些说明操作,但它告诉我没有子模块:
git submodule deinit .
No submodule mapping found in .gitmodules for path 'Src/Foo/FooBar'
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我正在尝试在Xcode 7中设置一个Bot进行集成测试.作为设置的一部分,我使用Xcode> Preferences> Accounts> Add Repository将远程存储库添加到项目中但是它失败并显示Authentication failed:
GitHub正在使用这个SSH密钥在命令行工作,为什么Xcode 7不工作?
我在Git下有我的WordPress项目,并将WordPress作为子模块.我想将我的主题开发保存在一个单独的子模块中,但是在当前设置中并且在将主题设置作为子模块时遇到一些困难.
这是我的文件系统:
/.git (master repo)
/index.php
/wp-config.php
/wordpress (WordPress repo as a submodule)
/wp-content
themes
test-theme (theme repo)
.git
index.php
(etc...)
Run Code Online (Sandbox Code Playgroud)
现在,当我将我的主仓库推送到github,并尝试在另一台机器上克隆它时,wordpress子模块下载正常,但我的主题文件夹没有,我得到一个关于未定义子模块的错误.
我尝试使用它将我的主题添加为子模块:
git submodule add ./wp-content/themes/test-theme/.git ./wp-content/themes/test-theme
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误:"remote(origin)没有在.git/config中定义的url"
如何将主题回购定义为子模块,当它基本上托管在项目"内部"而不是在线上的单独存储库中时?
谢谢.
我有即两个仓库A和B.错误地,我在我的机器上克隆了A里面的回购B. 我从repo B中删除了所有代码但是当我从A上推送并合并我的代码时,它还显示了BGithub repo上的子项目提交.
我想从我的master上删除子项目提交.这些步骤会起作用吗?
1. rmdir B (on my local repo A)
2. Pushing my repo A to origin
3. Merging
我正在尝试TeamCity 6.5.6使用git带有一个子模块的repo进行构建,但是"无法启动构建".
.gitmodules 文件:
[submodule "src/shared-contracts"]
path = src/shared-contracts
url = gitolite@myserver:shared-contracts
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
Failed to start build: Server was not able to build correct patch, most likely due to VCS errors, will try again.
jetbrains.buildServer.agent.impl.patch.PatchDownloaderImpl$1: Server was not able to build correct patch, most likely due to VCS errors, will try again.
Caused by: jetbrains.buildServer.vcs.patches.UnsuccessfulPatchException: Failed to build patch for build #s5 {build id=19947}, VCS root: gitolite@myserver:myrepo#mapi-qa {instance id=1152, parent id=280}, due to error: Patch building …
我认为这个问题已经在这个问题下讨论过:
但是我仍然无法将一些文件夹添加到 git 存储库,我需要帮助。
$ git status
...
# modified: folder_to_add1 (modified content, untracked content)
# modified: folder_to_add2 (modified content, untracked content)
Run Code Online (Sandbox Code Playgroud)
这些文件夹原本属于另一个git存储库,所以我进入这些文件夹并删除了里面的.git文件夹。
然后我跑了:
$ git add folder_to_add1
$ git add folder_to_add2
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# (commit or discard the untracked or modified content in submodules) …Run Code Online (Sandbox Code Playgroud) git ×6
github ×2
bots ×1
git-add ×1
git-commit ×1
gitlab ×1
repository ×1
ssh ×1
subproject ×1
teamcity ×1
wordpress ×1
xcode7 ×1