From: Jonathan Nieder Date: Mon, 08 Nov 2010 09:02:31 GMT Subject: Re: history missing Message-ID: <20101108090230.GC2430@burratino> In-Reply-To: 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 ", or "git fetch --all" if you want to update all remote-tracking branches. Inspecting a particular branch ------------------------------ Use "git fetch "; 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 git branch FETCH_HEAD but there is also a shorter way to write that: git fetch : 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 " 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