All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Vitaliy Semochkin <vitaliy.se@gmail.com>
Cc: git@vger.kernel.org, Sverre Rabbelier <srabbelier@gmail.com>
Subject: Re: history missing
Date: Mon, 8 Nov 2010 03:02:31 -0600	[thread overview]
Message-ID: <20101108090230.GC2430@burratino> (raw)
In-Reply-To: <AANLkTikFB5HNOmg0iTdjHxtrhU9vdua5O8btgFzpg-2F@mail.gmail.com>

Hi Vitaliy,

Vitaliy Semochkin wrote:

> I cloned a remote repository
> to check recent changes in origin/master I do:
> git fetch origin master
> git log origin master
> 
> recently I found out that log doesn't show recent commits

Yes, this can be confusing.

The "git fetch" command can be used in two ways: to update
remote-tracking branches and to grab some particular branch (or
other ref) quickly.

Updating remote-tracking branches
---------------------------------

Use "git fetch <remote>", or "git fetch --all" if you want to update
all remote-tracking branches.

Inspecting a particular branch
------------------------------

Use "git fetch <remote> <branch>"; this will fetch that branch and
store it as FETCH_HEAD.  You can "git log FETCH_HEAD", "git merge
FETCH_HEAD", etc, to interact with the branch head you just
downloaded.

If you want to fetch a branch to a local branch, you could use

	git fetch <remote> <branch>
	git branch <local-branch-name> FETCH_HEAD

but there is also a shorter way to write that:

	git fetch <remote> <branch>:<local-branch-name>

This form is especially useful for grabbing a subtree of the branch
hierarchy all at once:

	git fetch junio refs/heads/sg/*:gabor/*

The "git fetch <remote>" form is syntactic sugar for this syntax.  The
'fetch' lines in .git/config describe what remote:local ref specifiers
will be implicitly added to the command line after the name of a
configured remote repository.

See the "git fetch" manual for details and examples.

Hope that helps,
Jonathan

  parent reply	other threads:[~2010-11-08  9:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26 19:47 history missing Vitaliy Semochkin
2010-10-26 20:04 ` Sverre Rabbelier
2010-11-08  9:02 ` Jonathan Nieder [this message]
2010-11-08 11:56   ` Martin von Zweigbergk
2010-11-08 13:29     ` Jakub Narebski
2010-11-08 13:37       ` Martin von Zweigbergk
2010-11-08 13:48         ` Jakub Narebski
2010-11-08 14:14           ` Martin von Zweigbergk
2010-11-08 18:28             ` Jeff King
2010-11-08 11:29 ` Alex Riesen

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=20101108090230.GC2430@burratino \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=srabbelier@gmail.com \
    --cc=vitaliy.se@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.