git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SungHyun Nam <goweol@gmail.com>
To: git@vger.kernel.org
Subject: Re: git pull/merge master on other branch
Date: Tue, 13 May 2008 11:22:55 +0900	[thread overview]
Message-ID: <4828FB7F.3030907@gmail.com> (raw)
In-Reply-To: <8C649BDA-41CA-4105-86C5-103B4A8BEEC1@sb.org>

Kevin Ballard wrote, at 5/10/2008 2:16 AM:
 > On May 9, 2008, at 1:24 AM, Johan Herland wrote:
 >
 >> On Friday 09 May 2008, SungHyun Nam wrote:
 >>> Hello,
 >>>
 >>> If I am on a branch (reguarly rebased), I don't want to switch to
 >>> master branch, but merge origin into master.
 >>> If I switch to master and pull and switch to branch, I have to
 >>> rebuild almost of sources.
 >>>
 >>> How I can pull origin into master without switching to master
 >>> branch?
 >>
 >> You can't; merging requires use of the working tree (to resolve
 >> conflicts).
 >>
 >> However, what you can do is make a local clone of your project (cheap,
 >> because it just hardlinks files from the original repo), and 
checkout the
 >> master branch in the clone, perform the merge (after having set up the
 >> same
 >> origin and retrieved its contents), and then fetch (or push) the
 >> result back
 >> into the original repo (remember: "fetch" instead of "pull", since the
 >> latter will initiate a merge with your current branch).
 >
 >
 > If you know the pull will just be a fast-foward, then you can do
 > something like
 >
 >   git fetch origin && git update-ref master origin/master

It seems it worked, but I see a warning message "refname 'master'
is ambiguous." Can I fix this warning message?

[test] ~/tmp/t[52]$ git fetch origin
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
 From /d/user/namsh/tmp/repo/
    6e13bb5..8d1c620  master     -> origin/master
[test] ~/tmp/t[53]$ git update-ref master origin/master
[test] ~/tmp/t[69]$ git log master
warning: refname 'master' is ambiguous.
commit a358783b78facffb9a8f69d2189aa716495d95ba
..

[test] ~/tmp/t[54]$ git rebase master
warning: refname 'master' is ambiguous.
warning: refname 'master' is ambiguous.
First, rewinding head to replay your work on top of it...
Fast-forwarded test to master.

regards,
namsh

  reply	other threads:[~2008-05-13  2:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-09  5:26 git pull/merge master on other branch SungHyun Nam
2008-05-09  6:24 ` Johan Herland
2008-05-09  8:28   ` SungHyun Nam
2008-05-09  9:06     ` Johan Herland
2008-05-09 17:16   ` Kevin Ballard
2008-05-13  2:22     ` SungHyun Nam [this message]
2008-05-13 16:08       ` Lars Hjemli
2008-05-13 17:24     ` Brandon Casey
2008-05-13  3:12 ` Kelvie Wong

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=4828FB7F.3030907@gmail.com \
    --to=goweol@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).