Re: history missing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]