我正在使用的项目之一在 it/s .gitmodules 文件中:
\n(iit_synthesis) brando9~/proverbot9001 $ cat .gitmodules | grep \'metalib\'\n[submodule "deps/metalib"]\n path = deps/metalib\n url = git@github.com:plclub/metalib.git\nRun Code Online (Sandbox Code Playgroud)\n\n[submodule "coq-projects/metalib"]\n path = coq-projects/metalib\n url = git@github.com:plclub/metalib.git\nRun Code Online (Sandbox Code Playgroud)\n当我通过命令行执行此操作时,由于 gitignore 文件,它不允许我这样做:
\n(iit_synthesis) brandomiranda~/proverbot9001 \xe2\x9d\xaf git submodule add --name coq-projects/metalib https://git@github.com:plclub/metalib.git coq-projects/metalib\n\nThe following paths are ignored by one of your .gitignore files:\ncoq-projects\ncoq-projects/metalib\nhint: Use -f if you really want to add them.\nhint: Turn this message off by running\nhint: "git config advice.addIgnoredFile false"\nRun Code Online (Sandbox Code Playgroud)\n我打算手动修改它,但感觉很脏,很奇怪。然后我将强制它更新:
\ngit …Run Code Online (Sandbox Code Playgroud) 我在我的Linux机器上安装了一些Perl模块.如果我输入perldoc perllocal它显示我的机器中安装的Perl模块列表,但现在我不需要那些Perl模块,所以我想删除它们.
有谁知道如何卸载或删除Linux中安装的那些模块(debian 2.6.26)?
我在我的主目录下保留了很多文件git.重要的dotfiles,我的论文等
我想将某些文件推送到github,例如我的emacs配置,以便共享.
显然,我不想推动整个回购.还有submodules路要走?
我的第一个想法是在这里创建一个目录~/github/emacs和rsync选择性文件,然后在该目录下添加一个子模块,指向github,以进行推送.
这是一个好主意,还是有更好的方法?
(但我不希望我的本地git repo存储所有文件,但是这些内容会变得混乱.)
我正在尝试为我的drupal安装克隆一个子模块.我运行以下命令:
git submodule add http://git.drupal.org/project/token.git /sites/all/modules/token
Run Code Online (Sandbox Code Playgroud)
这会引发此错误:
The following path is ignored by one of your .gitignore files:
/sites/all/modules/token
Use -f if you really want to add it.
Run Code Online (Sandbox Code Playgroud)
但我的.gitignore文件是空的.
所以我尝试按照建议运行它:
submodule add -f http://git.drupal.org/project/token.git /sites/all/modules/token
Run Code Online (Sandbox Code Playgroud)
但是这会抛出这个错误:
fatal: could not create leading directories of '/sites/all/modules/token': Permission denied
Clone of 'http://git.drupal.org/project/token.git' into submodule path '/sites/all/modules/token' failed
Run Code Online (Sandbox Code Playgroud)
权限是777.
想法?
关心卢卡斯
不知道标题是否描述了我想说的内容,但这里是:
我想知道使用git子模块设置Jenkins时的"最佳实践".main和submodule repo都可以通过ssh访问,因为我们有几个用户,所有这些用户都有自己的用户名.对于拥有自己用户的Jenkins也是如此.但是,我们(我)偶然发现了一个问题.如果我创建一个子模块: git submodule添加ssh:// my-user-name @ address-to-module-repo并推送它,Jenkins会在尝试获取子模块时将我称为用户,这显然会失败.如果其他一些用户执行了拉取,我的用户名仍然在路径中(在.gitmodule,.git/config等等).
我在"普通"用户之间发现了另一个帖子Git子模块和ssh访问处理共享,但是当Jenkins尝试构建时,它并没有真正解决问题,因为我只允许在Jenkins取出所有我无法执行的操作后执行shell cmd如链接中提到的那样,还是可以(Jenkins新手)?
所以,总结一下.如何解决这个问题,以便在通过ssh获取子模块时Jenkins将使用自己的用户?
Br,Pistol先生
我有一个git repo,它有一些子目录:
~/src
~/src/.git
~/src/mystuff
~/src/otherstuff
Run Code Online (Sandbox Code Playgroud)
现在我想otherstuff与朋友分享,我打算用bitbucket做这件事.他们应该能够克隆它并推送更改,otherstuff但我不希望它们能够访问src,mystuff(甚至看不到它们存在).
我该怎么做?我几乎进入cd ~/src/otherstuff并做了git init,git remote add origin ssh://git@bitbucket.org/wim_glenn/...但是当它已经受版本控制时,有些事情没有闻到正确再次执行git init.
我正在使用Git 1.8.4和Linux(Kubuntu 13.10).
我有一个带子模块的Git存储库.如果我在主Git模块中请求目录差异,它可以正常工作.如果我在其中一个子模块中执行相同的操作,则会出现错误:
~/Projects/MAINMODULE/platform/SUBMODULE [master]$ git difftool -tool=meld --dir-diff --cached
fatal: Could not switch to '../../../../platform/': No such file or directory
diff --raw --no-abbrev -z --cached: command returned error: 128
~/Projects/MAINMODULE/platform/SUBMODULE [master]$ cd ..
~/Projects/MAINMODULE/platform [master]$ cd ..
~/Projects/MAINMODULE [master]$ git difftool -tool=meld --dir-diff --cached
// NO PROBLEM, works.
~/Projects/MAINMODULE [master]$ git version
git version 1.8.4
Run Code Online (Sandbox Code Playgroud)
你有什么主意吗?可能是Git Bug吗?
更新:1.8.5.3产生相同的输出
为了调试第三方库中的问题,我将他们的源代码复制到我自己的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)
有任何想法吗?
我正试图在另一台机器(Windows)上从GitHub克隆我的repo.我创建了一个新目录,并在新目录中运行以下命令:
git init .
git remote add origin https://github.com/meme/myRepo.git
git pull origin master
git push -u origin master
Run Code Online (Sandbox Code Playgroud)
为了拉动我正在使用的子模块我运行:
git pull --recurse-submodules
Run Code Online (Sandbox Code Playgroud)
但是在子模块目录中没有显示任何内容然后我运行:
git submodule update --recursive
Run Code Online (Sandbox Code Playgroud)
但是仍然没有在子模块目录中显示任何内容.
你们中的任何人都知道我做错了什么或者如何拉出子模块文件?
我真的很感谢你的帮助.
我有一个利用GitLab CI的GitLab项目。该项目还使用子模块,该项目及其子模块都在同一个GitLab帐户下。
这是我的.gitmodules档案
[submodule "proto_contracts"]
path = proto_contracts
url = https://gitlab.com/areller/proto_contracts.git
Run Code Online (Sandbox Code Playgroud)
我在.gitlab-ci.yml文件中也有这部分
variables:
GIT_SUBMODULE_STRATEGY: recursive
Run Code Online (Sandbox Code Playgroud)
但是,当我运行配置项时,出现此错误
fatal: could not read Username for 'https://gitlab.com': No such device or address
Run Code Online (Sandbox Code Playgroud)
项目和子模块都在私有存储库中,因此您会被提示进行身份验证,但是正如我已经提到的,项目和子模块在同一帐户下,运行者的工作之一是克隆原始存储库
因此,奇怪的是它无法到达子模块。有没有解决的办法?