使用sub-repos和submodule更改深度Git存储库 - 存储库 - 树的权限? [英] Changing permissions with deep Git repository-repository -tree with sub-repos and submodules?
问题描述
我决定在repository -tree中默认限制可见性范围,以便为抛光的东西创建public -folder。现在因为有许多子库,我正在接受一个痛苦的承诺或一些聪明的想法。我不确定最好的方法 - 我想过用find来遍历回购,然后就像默认perms和公开的东西在public根获得质量
但我可能会重新发明轮子。我无法限制子存储库和子模块的数量,因此提交必须从最低的存储库开始,然后如果使用find进行一点点遍历。
如何处理这种深度Git repo-repo -tree更新?
也许有关
使用更好的工具
避免像 $ find。 -exec git checkout'{}'\;
,然后递归/手动修复权限。有一种名为Gitslave的工具可以更容易地管理扩展的投资组合。有价值的文章此处。我还建议你阅读这个主题这里,SethRobertson的文章再次出现 - 非常好的阅读。
您为什么需要Gitslave?
$ b
假设您进行了更改到像
Works.git> Project.git> Pictures.git> Happy这样的结构中的repo
。然后,有人Happy.git
。 GIT中
试图从你的裸机回购中取出,比如Project.git
。因为
你是一个git,你只能在Happy.git
中提交。现在你的
朋友会得到一些令人讨厌的错误。一个懒惰的git会使用
gitslave
-tool。$ mkdir t1; cd t1; mkdir t2; cd t2; mkdir t3; git init;回声t3> t3; git add。; git commit -mt3; cd ..; git init;回声t2> t2; git add。; git commit -mt2; git init;回声t1> t1; git add。; git commit -mt1; cd ..; cd t1 / t2 / t3;只回声仅在这里>; git add。; git commit -monly; cd ../ ..; git status
#在分支主机上
#未记录文件:
#(使用git add< file> ...来包含在提交的内容中)
#
#t2 /
$看起来你需要做重复的工作,因为你没有使用Gitslave!
安装Gitslave的演练
不幸的是,Gitslave还没有在Apt-get中下载
这里。
它看起来有点像Maven,更多
此处。
您可以通过它管理您的项目。首先,你指定super-repo
,然后你附上slave -repos。
$ p $ git clone http: //someGitRepoHere.com/xyz.git super
$ cd super; gits prepare
$ gits attach http://someBareRepo.git yourDirHere
更多内容如153
here。
当Gitslave进入包装时,管理软件,如apt-get,因此对人们更有用。
I decided to restrict the scope of visibility by default in repository -tree so that public -folder will be created for polished things. Now because there are many sub-repositories, I am getting a painful commiting or some smart idea. I am not sure about the best way -- I thought about traversing the repos with find and then just doing a consistent -dummy commit to every repo like "default perms lower and polished public things to public dir in the root to get the quality up"
but I may be reinventing the wheel. It is not option for me to limit the amount of sub-repositories and submodules so commiting must start from the lowest repo and then little by little traversing up if doing with find.
How would handle this kind of deep Git repo-repo -tree update?
Perhaps related
Use better tools!
Avoid hacks such as $ find . -exec git checkout '{}' \;
and then recursively/manually fixing permissions. There is a tool called, Gitslave, to manage expanding portfolios more easily. Valuable article here. I also suggest you to read this thread here, again the SethRobertson's article emerging -- very good reading.
Why do you need Gitslave?
Suppose you make a change to the repo
Happy.git
in structure like"Works.git > Project.git > Pictures.git > Happy.git"
. Then someone tries to pull from your bare -git repo such asProject.git
. Because you was a git, you only committed things inHappy.git
. Now your friend will get some nasty error. A lazy git would have used thegitslave
-tool.$ mkdir t1; cd t1; mkdir t2; cd t2; mkdir t3; git init; echo "t3" >t3; git add .; git commit -m "t3"; cd ..; git init; echo "t2" >t2; git add .; git commit -m "t2"; git init; echo "t1" >t1; git add .; git commit -m "t1"; cd ..; cd t1/t2/t3; echo "only here">only; git add .; git commit -m "only"; cd ../..; git status # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # t2/ $ Look you need to do repetitive work because you did not use Gitslave!
Walkthrough to install Gitslave
Unfortunately, Gitslave is not yet in Apt-get so download here.
It looks a bit like Maven, more here. You manage your project by it. Firstly, you specify the super -repo and then you attach the slave -repos.
$ git clone http://someGitRepoHere.com/xyz.git super $ cd super; gits prepare $ gits attach http://someBareRepo.git yourDirHere
More on the lines such as 153 here.
I will continue this answer the time Gitslave gets into the package-management softwares such as apt-get so it is more useful to people.
这篇关于使用sub-repos和submodule更改深度Git存储库 - 存储库 - 树的权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!