From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: when is a remote a branch?
Date: Sun, 12 Nov 2006 17:11:41 +0100 [thread overview]
Message-ID: <ej7h1n$ed8$1@sea.gmane.org> (raw)
In-Reply-To: ej7fra$8ca$2@sea.gmane.org
Anand Kumria wrote:
> I generally tend to use cogito -- it does all the heavy lifting, like
> recovering from interrupted fetchs (usually) for me. One thing I haven't
> really gotten my head around is the difference between a branch and a
> remote.
>
> git-branch knows of 'remotes' (via the -r parameter) and these to be
> unrelated to what cogito thinks remotes are (it seems to look for things
> in .git/refs/head/<name> and then a corresponding .git/branches/<name>/
> which it then declares a remote).
Not about 'remotes', but about 'remote [read-only] branches', i.e. refs not
from .refs/heads/, but from .refs/remotes/<remotename>/
> Yet, git-init-db creates both .git/remotes and .git/branches
>
> What is the difference between the two. From my (na?ve) perspective the
> two tools (git and cogito) regarded them very differently.
>
> Any explanation, or pointer to some documentation, would be helpful.
Read Documentation/repository-layout.txt (ot it's HTML version, either
locally ot at www.kernel.org).
branches::
A slightly deprecated way to store shorthands to be used
to specify URL to `git fetch`, `git pull` and `git push`
commands is to store a file in `branches/'name'` and
give 'name' to these commands in place of 'repository'
argument.
You can store only one branch to fetch per shorthand. I'm not sure about
where it is stored which branch to download, and how to name this branch
locally.
remotes::
Stores shorthands to be used to give URL and default
refnames to interact with remote repository to `git
fetch`, `git pull` and `git push` commands.
From Documentation/urls.txt
In addition to the above, as a short-hand, the name of a
file in `$GIT_DIR/remotes` directory can be given; the
named file should be in the following format:
URL: one of the above URL format
Push: <refspec>
Pull: <refspec>
Currently there is yet another way, by using config file:
(also from Documentation/urls.txt):
Or, equivalently, in the `$GIT_DIR/config` (note the use
of `fetch` instead of `Pull:`):
[remote "<remote>"]
url = <url>
push = <refspec>
fetch = <refspec>
where <refspec> is defined in Documentation/fetch-pull-param.txt
<refspec>::
The canonical format of a <refspec> parameter is
`+?<src>:<dst>`; that is, an optional plus `+`, followed
by the source ref, followed by a colon `:`, followed by
the destination ref.
(or, simply, in git-pull(1), which includes those files, with exception of
repository layout document).
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
next prev parent reply other threads:[~2006-11-12 16:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-12 15:50 when is a remote a branch? Anand Kumria
2006-11-12 16:11 ` Jakub Narebski [this message]
2006-11-12 16:36 ` Petr Baudis
2006-11-12 17:31 ` Jakub Narebski
2006-11-14 20:28 ` Petr Baudis
2006-11-14 20:36 ` Jakub Narebski
2006-11-14 20:44 ` Petr Baudis
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='ej7h1n$ed8$1@sea.gmane.org' \
--to=jnareb@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