Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is an implied argument to <code>git log</code> when you don't specify a reference or set of references. It is the current head. So</p> <pre><code>git log </code></pre> <p>expands to</p> <pre><code>git log HEAD </code></pre> <p>which means show me all the commits reachable from the current HEAD (where your next commit will attach).</p> <p>In order to see your colleague's work, you can</p> <pre><code>git log origin/master </code></pre> <p>assuming you are both working on master and you fetched already. </p> <p>In git, fetch means get the commits from the remote <strong>but don't update any of my local branches</strong>. <code>git pull</code> will do fetch and then merge your branch with what it fetched. It is a good idea to fetch, inspect what was done and then merge or rebase or even reject what was done with a force push - depends on the situation and your workflow.</p> <p>typically, to see what was done on the remote after a fetch you can</p> <pre><code>git log ..origin/master </code></pre> <p>this really expands to</p> <pre><code>git log HEAD..origin/master </code></pre> <p>the <code>..</code> operator is short hand for combining "exclude reachable commits from this reference" and "include reachable commits from this reference". So it could also be written like this:</p> <pre><code>git log ^HEAD origin/master </code></pre> <p>the <code>^</code> at the beginning of a reference means exclude the commits reachable from here. In this case it means what you have reachable from where you are. The result will be a list of the commits on this branch just fetched from the server.</p> <p>Instead of listing all the branches and remote branches as arguments to <code>git log</code>, you can just use the <code>--all</code> parameter:</p> <pre><code>git log --all </code></pre> <p>which will show all commits reachable from all branches (local and remote tracking) and tags.</p> <p><code>git log</code> is a very powerful command due to how it allows you to do set based reductions of what commits you want to see. <code>..</code> is a good syntax to know. There is also <code>...</code> which says to include commits from both the branches specified down to their common ancestor.</p> <p>This walking of history is what makes git so powerful and able to support so many interesting workflows.</p> <p><strong>UPDATE:</strong></p> <p>When git encounters commits that are identical in terms of what is contained in the tree stored there with it's parent, it will not list the commit when it walks a merge.</p> <pre><code>git log --all --sparse </code></pre> <p>will not exclude those commits.</p> <p>see the history simplification section of <a href="http://linux.die.net/man/1/git-log">http://linux.die.net/man/1/git-log</a></p> <p>It could also mean that you reset a branch or your friend did and fetching again has lost that reference. When you do git log with the sha1, what is the output if you add --decorate to it? Also try <code>git log --walk-reflogs</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload