git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ross Boylan <ross@biostat.ucsf.edu>
To: Junio C Hamano <gitster@pobox.com>
Cc: Chris Packham <judge.packham@gmail.com>, git@vger.kernel.org
Subject: Re: confused about remote branch management
Date: Wed, 23 Jul 2014 16:30:52 -0700	[thread overview]
Message-ID: <1406158252.29001.223.camel@localhost> (raw)
In-Reply-To: <xmqqmwbzda80.fsf@gitster.dls.corp.google.com>

On Wed, 2014-07-23 at 14:41 -0700, Junio C Hamano wrote:
> Ross Boylan <ross@biostat.ucsf.edu> writes:
> 
> > I still don't know what I need to do to update origin/master in my local
> > repo.
> >
> > Regarding Kevin's suggestion, I just tried "git fetch origin master".
> 
> I think Kevin's suggestion was 'To older git, "git fetch origin
> master" tells it to fetch master without updating origin/master, so
> it is understandable that your origin/master was not molested'.
> 
> Either
> 
> 	git fetch origin master:refs/remotes/origin/master
Great; that works.
Is that procedure supposed to be the usual way I track upstream in this
(1.7) version of git?  It seems arcane.

I had thought the usual workflow was supposed to be one of 2
alternatives, either
git checkout remotes/origin/master
git pull origin master
git checkout master
git merge remotes/origin/master
But that failed on the first step.  Or

# assuming we are on the local master branch
git fetch origin master
# and everything is updated.

Is the problem that I called the local branch with my modifications
master instead of something else?
> 
> or if you want to be more explicit and unambiguous:
> 
> 	git fetch origin refs/heads/master:refs/remotes/origin/master
> 
> should work on all versions of git.

After studying man git-fetch's discussion of the refspec parameter,
especially the second note: 

	You never do your own development on branches that appear on the right
hand side of a <refspec> colon on Pull: lines; they are to be updated by
git fetch. If you intend to do development derived from a remote branch
B, have a Pull: line to track it (i.e. Pull: B:remote-B), and have a
separate branch my-B to do your development on top of it. The latter is
created by git branch my-B remote-B (or its equivalent git checkout -b
my-B remote-B). Run git fetch to keep track of the progress of the
remote side, and when you see something new on the remote branch, merge
it into your development branch with git pull . remote-B, while you are
on my-B branch.

I'm even more confused.  Is "Pull: lines" a reference to log messages
during the fetch, a configuration file, or something else?  The docs
refer to a pull: line in $GIT_DIR/remotes, but I have no such directory.
I do have .git/config, which includes
[remote "personal"]
	url = https://github.com/RossBoylan/ESS.git
	fetch = +refs/heads/*:refs/remotes/personal/*
[branch "master"]
	remote = personal
	merge = refs/heads/master
[remote "origin"]
	url = https://github.com/emacs-ess/ESS.git
	fetch = +refs/heads/*:refs/remotes/origin/*

Ah!  branch master is associated with the personal remote; is that why
updating it from origin's master branch has no effect on origin/master?

I also don't know what the "." in "git pull . remote-B" does; the
git-pull manpage doesn't indicate it's legal as far as I can see.

Ross

  reply	other threads:[~2014-07-23 23:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23  2:49 confused about remote branch management Ross Boylan
2014-07-23  7:40 ` Chris Packham
2014-07-23 19:22   ` Ross Boylan
2014-07-23 21:41     ` Junio C Hamano
2014-07-23 23:30       ` Ross Boylan [this message]
2014-07-23 23:51         ` Junio C Hamano
2014-07-24  0:24           ` Ross Boylan
2014-07-23 13:30 ` Kevin
     [not found] ` <CAO54GHBEexASvZcdJqDtgYkfecGbuZFLneC6Nr8u6CYfXuUPog@mail.gmail.com>
2014-07-23 18:54   ` Ross Boylan

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=1406158252.29001.223.camel@localhost \
    --to=ross@biostat.ucsf.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=judge.packham@gmail.com \
    /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).