From: Jonathan Tan <jonathantanmy@google.com>
To: <eero.aaltonen@vaisala.com>
Cc: <git@vger.kernel.org>
Subject: Re: Behavior of 'git fetch' for commit hashes
Date: Mon, 19 Jun 2017 10:49:36 -0700 [thread overview]
Message-ID: <20170619104936.706eff69@twelve2.svl.corp.google.com> (raw)
In-Reply-To: <14e804c6-0798-8bbd-b182-66c3cd2b870c@vaisala.com>
On Mon, 19 Jun 2017 12:09:28 +0000
<eero.aaltonen@vaisala.com> wrote:
> For version 2.7.4
> =================
> Git exits with exit code 1.
>
> However, if I first do 'git fetch <branch>', then 'git fetch <sha1> will
> also work
>
> * branch <sha1> -> FETCH_HEAD
I suspect that what is happening is that 'git fetch <branch>' also
downloads the commit referenced by <sha1>, so the subsequent 'git fetch
<sha1>' is a no-op (except setting FETCH_HEAD).
> For version 2.13.3
> ==================
> Git exits with exit code 128 and message
> fatal: Couldn't find remote ref
>
> However, the workaround for descbibed abot for git version 2.7.4 no
> longer works. The result is always
> fatal: Couldn't find remote ref
I'll take a look into this.
> Desired result
> ==============
> Commit is in .git/FETCH_HEAD and can be checked out.
>
>
> I want to checkout a specific commit without creating any extra named
> remotes in the local git clone.
>
> Finally,
> What is the expected behavior for 'git fetch' in this case?
> Is there some other way I can achieve my goals?
I'll take a look into the expected behavior, but if my assumptions are
correct, you should be able to just checkout the commit you want after
fetching the branch:
git fetch <forkUrl> <branch>
git checkout <sha1>
next prev parent reply other threads:[~2017-06-19 17:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-19 12:09 Behavior of 'git fetch' for commit hashes eero.aaltonen
2017-06-19 15:50 ` Stefan Beller
2017-06-19 17:49 ` Jonathan Tan [this message]
2017-06-19 22:26 ` Jonathan Tan
2017-06-20 11:32 ` eero.aaltonen
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=20170619104936.706eff69@twelve2.svl.corp.google.com \
--to=jonathantanmy@google.com \
--cc=eero.aaltonen@vaisala.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).