From: Jay Soffian <jaysoffian@gmail.com>
To: John Dlugosz <JDlugosz@tradestation.com>
Cc: git@vger.kernel.org
Subject: Re: remote tracking branches
Date: Wed, 25 Feb 2009 12:53:14 -0500 [thread overview]
Message-ID: <76718490902250953u2c6a7783x89c1ea49d045a49a@mail.gmail.com> (raw)
In-Reply-To: <450196A1AAAE4B42A00A8B27A59278E709E0485C@EXCHANGE.trad.tradestation.com>
On Wed, Feb 25, 2009 at 12:41 PM, John Dlugosz
<JDlugosz@tradestation.com> wrote:
> The repository on my machine was apparently originally a simple file
> copy from another development machine, or set up manually. That is, was
> not done by using the "git clone" command. I have a [remote "pub"] in
> the config file with only a url in it, so I can use "pub" when I push
> and pull.
>
> The command "git branch -r" shows nothing.
>
> So, there are no remote tracking branches. So what? At first, I think
> that this is nothing more than the defaults to use when pulling, to get
> everything. But, the example at the very end of Chapter 1 of the user
> manual shows:
> fetch = +refs/heads/*:refs/remotes/linux-nfs/*
>
> I don't have a refs/remotes directory now. So what does
> git pull pub xx
> do? The _result_ is just fine, as expected. But if pull calls fetch,
> it needs to fetch it to some temporary place first and then merge that,
> right?
FETCH_HEAD is the temporary place.
> If I add a suitable line to my config file (changing linux-nfs in the
> example to pub to match the remote name), what does that buy me? But
> first, is that all I need to do to enable this feature?
Yes.
$ git config remote.pub.fetch "+refs/heads/*:refs/remotes/pub/*"
will command fetch to store what it retrieves under refs/remotes/pub
as well as in FETCH_HEAD.
> I'm guessing that it means I will be able to examine, e.g. using gitk,
> what is in pub, to see if there are changes I need and keep apprised of
> other's work.
Well it also lets you track every branch that is on pub. Otherwise
you're only retrieving whatever HEAD is on the remote. You may also
find it more natural to examine changes before merging them w/remote
tracking branches. e.g.:
$ git fetch
$ git log pub/master..master
Oh, and "git branch -v" can now tell you how far ahead/behind your
local branch is compared to the remote tracking branch.
j.
prev parent reply other threads:[~2009-02-25 17:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-25 17:41 remote tracking branches John Dlugosz
2009-02-25 17:53 ` Jay Soffian [this message]
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=76718490902250953u2c6a7783x89c1ea49d045a49a@mail.gmail.com \
--to=jaysoffian@gmail.com \
--cc=JDlugosz@tradestation.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).