0

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

  1. Git: how to avoid repetitive committing with sub-sub-sub... Git -repos?

  2. Git: a tool to manage and to structure Projects?

Community
  • 1
  • 1
hhh
  • 50,788
  • 62
  • 179
  • 282

1 Answers1

0

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 as Project.git. Because you was a git, you only committed things in Happy.git. Now your friend will get some nasty error. A lazy git would have used the gitslave -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.

Community
  • 1
  • 1
hhh
  • 50,788
  • 62
  • 179
  • 282
  • Please, read the discussion in this thread [here](http://stackoverflow.com/a/12028300/164148) -- gitslave may not be the optimal solution for the problem, not yet sure. There exist also something like git-subtree, no experience with it sorry -- both git-subtree and gitslave are not yet in base so this thread and the latter should carefully be peer-reviewed, thanks. – hhh Aug 19 '12 at 17:32