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.