From: Junio C Hamano <gitster@pobox.com>
To: kenneth johansson <ken@kenjo.org>
Cc: git@vger.kernel.org
Subject: Re: tracking repository
Date: Sat, 15 Mar 2008 19:42:23 -0700 [thread overview]
Message-ID: <7vabkzmltc.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <frh8dg$t9j$1@ger.gmane.org> (kenneth johansson's message of "Sat, 15 Mar 2008 19:35:12 +0000 (UTC)")
kenneth johansson <ken@kenjo.org> writes:
> This works great and it will track all changes in the remote repositories
> without me having to worry about it aborting due to merge issues with my
> local branch or remote doing rebase on some branch.
>
> The problem is that it is useless :( I can't find any way to use a
> repository with only remotes in it. Is there a way to make a clone of a
> remote branch in a repository ??
Usually a clone with a work tree ("git clone $elsewhere") is configured to
keep copies of branches at the remote in remotes/origin in order to track
them, and that is done by having this in its .git/config:
[remote "origin"]
url = $elsewhere
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
This lets you to have your own work on your own "master", and have changes
on the other end merged when you "git pull" from there, while keeping
track of other branches on the other end in remotes/origin/ namespace.
You do not want to have any of your own work in this repository, however,
so there is no reason to separate the remote ones in remotes/origin/
namespace. You would want "mirroring".
You can have in your $GIT_DIR/config something like this:
[remote "origin"]
url = $elsewhere
fetch = +refs/heads/*:refs/heads/*
You can edit the configuration file yourself to read like above, and then
"git fetch" will keep a copy of remote "master" branch in your local
"master" (and similarly to all the branches over there).
Modern git allows this setup via "git remote add --mirror"; it is merely a
convenience wrapper and it is perfectly fine to edit the configuration
file yourself without using it.
next prev parent reply other threads:[~2008-03-16 2:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-15 19:35 tracking repository kenneth johansson
2008-03-16 2:42 ` Junio C Hamano [this message]
2008-03-16 20:02 ` kenneth johansson
2008-03-16 20:38 ` Junio C Hamano
2008-03-16 21:28 ` Daniel Barkalow
2008-03-16 21:57 ` Junio C Hamano
2008-03-16 22:18 ` Daniel Barkalow
2008-03-16 22:30 ` Junio C Hamano
2008-03-16 23:01 ` Junio C Hamano
2008-03-16 23:11 ` Daniel Barkalow
2008-03-17 0:17 ` Junio C Hamano
2008-03-17 0:35 ` Junio C Hamano
2008-03-17 2:13 ` Daniel Barkalow
2008-03-17 2:37 ` Daniel Barkalow
2008-03-17 7:48 ` Junio C Hamano
2008-03-17 16:23 ` Daniel Barkalow
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=7vabkzmltc.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ken@kenjo.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