From: John Clemens <clemej@gmail.com>
To: git@vger.kernel.org
Subject: mirroring and development with three levels of repositories?
Date: Tue, 28 Sep 2010 13:25:40 -0400 [thread overview]
Message-ID: <AANLkTinFiOA6Grzk16W2D=k8Xt+EgTanrS7iryW2evop@mail.gmail.com> (raw)
Apologies in advance for the long question. I'm obviously doing something
wrong, but I'm not sure what and searching hasn't provided me with anything.
If there is a git-users mailing list this would be more appropriate for,
please tell me.
Short question:
It it possible for a bare repository to have both local (company-wide) and
remote (mirroring upstream) branches, as well as serving those branches to our
devs? If so, how?
Long question:
We're working on a project that's a collaboration between several companies.
The full tree for everyone is stored on a central server that, for firewall
reasons, only one person can access in the company. So, that person creates
and updates nightly a local mirror of the central server. We then have a few
branches of our own that we do development on inside the company, and
periodically merge those branches into the main ones and push them upstream.
In mercurial, we do the branching by cloning the local mirror on our internal
server, having the devs push and pull from that repo, and then pushing those
changes to our local mirror, which gets pushed to the central server.
Now the central server has some things using git, and the git repo has
6 branches within it, as opposed to individual repos. The setup looks
like this:
+----------+
| upstream | <--- contains tree with 6 branches
+----------+
|
------------- <---- firewall
|
+--------------+
| Local Mirror | <--- "git clone --mirror" from upstream.
+--------------+
|
|---------|
+-----+ +-----+
| dev | | dev |
+-----+ +-----+
I would like to create two company-wide branches here that remain local,
one that branches from upstream's HEAD, and one that branches from one
of the existing branches on upstream (call it branch-a). I then want the devs
to be able to git clone our mirror, and then switch to our company-local branch
and hack away, putting thier changes on the company-wide server.
I thought I'd do this in git by the following:
(on client/dev machine):
$ git clone http://local-server/local-mirror.git
For later reference:
$ git remote show origin
* remote origin
Fetch URL: http://local-server/local-mirror.git
Push URL: http://local-server/local-mirror.git
HEAD branch: xxx/stable
Remote branches:
feature tracked
branch-a tracked
xxx/master tracked
xxx/feature1 tracked
xxx/feature2 tracked
xxx/stable tracked
Local branch configured for 'git pull':
xxx/stable merges with remote xxx/stable
Local ref configured for 'git push':
xxx/stable pushes to xxx/stable (up to date)
Then, we create a new branch and push it to the server:
$ git branch company-name/test1
$ git push origin company-name/test1
So far, so good, gitweb shows the new beanch in the mirror, pointing to
HEAD. Now lets create and push the other new company-wide branch:
$ git checkout -b company-name/branch-a origin/branch-a
$ git push origin company-name/branch-a
Again, all seems well. gitweb shows the new company-name/* branches on the
local server.
However, when you do a new clone of the local mirror, it now fails:
$ git clone http://local-server/local-mirror.git
Initialized empty Git repository in /home/clemej/git/local-mirror/.git/
warning: remote HEAD refers to nonexistent ref, unable to checkout.
$ git branch -a
remotes/origin/company-name/test1
remotes/origin/company-name/branch-a
Note the distinct absense of all the other branches in the repository.
$ git remote show origin
* remote origin
Fetch URL: http://local-server/local-mirror.git
Push URL: http://lodql-server/local-mirror.git
HEAD branch: (unknown)
Remote branches:
company-name/test1 tracked
company-name/branch-a tracked
Jumping over to the server, we see:
$ cd local-mirror.git/
$ git remote show origin
* remote origin
Fetch URL: http://upstream/tree.git
Push URL: http://upstream/tree.git
HEAD branch: xxx/stable
Remote branches:
company-name/test1 stale (use 'git remote prune' to remove)
company-name/branch-a stale (use 'git remote prune' to remove)
feature tracked
branch-a tracked
xxx/master tracked
xxx/feature1 tracked
xxx/feature2 tracked
xxx/stable tracked
Local refs will be mirrored by 'git push'
So, I'm obviously not thinking about this the right way. It it possible
for a bare repository to have both local (company-wide) and remote (mirroring
upstream) branches, as well as serving those branches to our devs? If so, how?
Thanks for your time,
john.c
--
John Clemens <clemej@gmail.com>
next reply other threads:[~2010-09-28 17:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-28 17:25 John Clemens [this message]
2010-09-28 17:37 ` mirroring and development with three levels of repositories? Enrico Weigelt
2010-09-28 18:27 ` John Clemens
2010-09-28 18:41 ` Enrico Weigelt
2010-09-29 1:58 ` John Clemens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTinFiOA6Grzk16W2D=k8Xt+EgTanrS7iryW2evop@mail.gmail.com' \
--to=clemej@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).