From: "Emily Ren" <lingyan.ren@gmail.com>
To: "Andreas Ericsson" <ae@op5.se>
Cc: "Git Mailinglist" <git@vger.kernel.org>
Subject: Re: How to pull remote branch with specified commit id?
Date: Tue, 13 Jan 2009 21:15:03 +0800 [thread overview]
Message-ID: <856bfe0e0901130515o5739bcbft1927f42a2dd85ad3@mail.gmail.com> (raw)
In-Reply-To: <496C5BE3.2040206@op5.se>
Andreas,
I tried your method, it works. Thank you very much !
Emily
On Tue, Jan 13, 2009 at 5:16 PM, Andreas Ericsson <ae@op5.se> wrote:
> Emily Ren wrote:
>>
>> Git experts,
>>
>> I want to pull remote branch with specified commit id, how to do it?
>>
>> Below command can get remote branch
>> $git pull remote refs/heads/$branch_name
>>
>> Below command doesn't work
>> $git pull remote objects/$commit_id
>>
>
> You need to fetch it first, and then merge the commit you want. The
> tools operating the fetching protocol only use refs, so if you want
> to fetch (or pull) a specific version that has neither a tag nor a
> branch head pointing to it, you'll have to write a new tool for that.
>
> The end-result of the following command will be, barring side-effects
> in the remote-tracking branches, identical to what you're trying to
> do though:
> git fetch remote && git merge $commit_id
>
> --
> Andreas Ericsson andreas.ericsson@op5.se
> OP5 AB www.op5.se
> Tel: +46 8-230225 Fax: +46 8-230231
>
next prev parent reply other threads:[~2009-01-13 13:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 9:08 How to pull remote branch with specified commit id? Emily Ren
2009-01-13 9:16 ` Andreas Ericsson
2009-01-13 13:15 ` Emily Ren [this message]
2009-01-13 9:43 ` Johannes Sixt
2009-01-13 21:57 ` Brad King
2009-01-14 5:54 ` thestar
2009-01-14 7:02 ` Johannes Sixt
2009-01-14 7:01 ` Johannes Sixt
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=856bfe0e0901130515o5739bcbft1927f42a2dd85ad3@mail.gmail.com \
--to=lingyan.ren@gmail.com \
--cc=ae@op5.se \
--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).