From: Woody Wu <narkewoody@gmail.com>
To: git@vger.kernel.org
Subject: How to specify remote branch correctly
Date: Mon, 17 Dec 2012 02:30:00 +0000 (UTC) [thread overview]
Message-ID: <slrnkct0r3.dsp.narkewoody@zuhnb712.local.com> (raw)
Hi, List
I have two branches in the remote, say, origin/master, origin/foo. Then
when I tried to switch to the remote foo branch, the following two
methods gave me different results:
1. git checkout foo
2. git checkout origin/foo
The first method run silently with success, but the second method
complains that I got a 'detached HEAD'. So, I think I don't understand
the difference between 'foo' and 'origin/foo'. Can someone give me a
hint?
Supposing I have another remote defined in .git/config that points
to another repository but also have a same name branch, say
'remote-x/foo', how do I tell git which 'foo' I want to switch to?
The similar problem also exists for 'fetch' command to me. From the man
page, I don't find answer of how to specify which remote I am going to
fetch from. Can you help me?
Thanks in advance.
--
woody
I can't go back to yesterday - because I was a different person then.
next reply other threads:[~2012-12-17 3:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-17 2:30 Woody Wu [this message]
2012-12-17 4:27 ` How to specify remote branch correctly Andrew Ardill
2012-12-17 5:06 ` Woody Wu
2012-12-17 5:13 ` Andrew Ardill
2012-12-17 5:30 ` Tomas Carnecky
2012-12-17 5:52 ` Andrew Ardill
2012-12-17 6:44 ` Chris Rorvick
2012-12-17 7:02 ` Woody Wu
2012-12-17 7:21 ` Tomas Carnecky
2012-12-17 7:41 ` Woody Wu
2012-12-17 6:48 ` Woody Wu
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=slrnkct0r3.dsp.narkewoody@zuhnb712.local.com \
--to=narkewoody@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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).