threads / discuss / 16603

Using repo to work with multiple GIT repositories

Subject: Using repo to work with multiple GIT repositories

## tl;dr

2 messages between Dec 5, 2008 and Dec 8, 2008.

replies: 1people: 2as markdown or json

kanagesh radhakrishnan· Dec 5, 2008, 11:20 UTC · lore
Hello All,
My work currently resides in four different source trees, namely:
   * bootloaders   (git://192.168.10.1/bootloaders)
   * kernel           (git://192.168.10.1/kernel)
   * applications  (git://192.168.10.1/apps)
   * build             (git://192.168.10.1/build)

I maintain them as four different git repositories. They are hosted on a local server enabling any other developer to be able to clone from one of the trees, make changes, commit locally and then push to the git server.

I was browsing through the Android source code and found that they have a similar situation where code is maintained in a large number of independent GIT repositories. The tool 'repo' is being used to initialize and sync each tree.

I have been trying to bring in this approach to maintain my work too. I have had success to some extent :-) I have created a manifest.git and repo.git in my local server. The default.xml file being maintained in manifest.git has a list of the GIT repositories being hosted by my local GIT server.

In order to clone the four GIT trees from the server, I do the following:
   $ repo init -u git://192.168.10.1/manifest.git
   $ repo sync
This clones from the four source trees maintained in the GIT server.

I am able to make changes locally in each tree and commit them. However, when I attempt to push the commits to the main repository on the GIT server, it always says that 'everything is up to date'

   $ git push user@192.168.10.1:/home/git/applications
   user@192.168.10.1's password:
   Everything up-to-date

Further, when I try to pull in any recent updates with the git-pull command, I get the following error:

   $ git-pull
   fatal: 'origin': unable to chdir or not a git archive
   fatal: The remote end hung up unexpectedly
I know pushing to the repository on the GIT server works since I am
able to push local commits when I have cloned the working copy
manually (instead of using repo init and repo sync).
-----------------------------------------------------------------
   $ git-clone git://192.168.10.1/applications
   Initialized empty Git repository in /home/user/work/applications/.git/
   remote: Counting objects: 6857, done.
   remote: Compressing objects: 100% (3805/3805), done.
   remote: Total 6857 (delta 2943), reused 6853 (delta 2941)
   Receiving objects: 100% (6857/6857), 9.51 MiB | 10547 KiB/s, done.
   Resolving deltas: 100% (2943/2943), done.
   $
   <edit, make changes, save, commit changes locally>
   $ git-commit -a -m "Changed rule to build with custom tools"
   Created commit bd55a06: Changed rule to build with custom tools
   1 files changed, 1 insertions(+), 1 deletions(-)
   $
   <push changes to repository on GIT server>
   $ git-push user@192.168.10.1:/home/git/applications
   user@192.168.10.1's password:
   Counting objects: 8, done.
   Compressing objects: 100% (6/6), done.
   Writing objects: 100% (6/6), 611 bytes, done.
   Total 6 (delta 4), reused 0 (delta 0)
   To user@192.168.10.1:/home/git/applications
   dce4bea..bd55a06  master -> master
   $
-----------------------------------------------------------------

May I know what I have to look at to solve this problem? Has anyone faced a similar problem? Any pointers would be of help.

Thanks in advance.

Regards, Kanagesh

Shawn O. Pearce· Dec 8, 2008, 16:23 UTC · re: kanagesh radhakrishnan · lore

Re: Using repo to work with multiple GIT repositories

kanagesh radhakrishnan <rkanagesh@gmail.com> wrote:
Show 17 quoted lines
> 
> My work currently resides in four different source trees, namely:
> 
>    * bootloaders   (git://192.168.10.1/bootloaders)
>    * kernel           (git://192.168.10.1/kernel)
>    * applications  (git://192.168.10.1/apps)
>    * build             (git://192.168.10.1/build)
> 
> I maintain them as four different git repositories.  They are hosted
> on a local server enabling any other developer to be able to clone
> from one of the trees, make changes, commit locally and then push to
> the git server.
> 
> I was browsing through the Android source code and found that they
> have a similar situation where code is maintained in a large number of
> independent GIT repositories.  The tool 'repo' is being used to
> initialize and sync each tree.

FWIW this was cross-posted to repo-discuss, which is possibly better suited to discussion about "repo". :-)

I posted my answer there this morning:
http://groups.google.com/group/repo-discuss/browse_thread/thread/67fdbba9619084
-- 
Shawn.

← back to recent threads