Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h3>Git Operates Locally by Design</h3> <p>The distributed nature of Git is fundamentally designed around a couple of fundamental concepts:</p> <ol> <li>Most operations are local, with a few minor exceptions like <em>push</em> and <em>ls-remote</em>.</li> <li>History is <em>calculated</em> from commit objects.</li> </ol> <p>What this means is that exploring history is a local operation, and can't be performed on a remote repository.</p> <h3>Remote References</h3> <p>The <em>git-ls-remote</em> command is useful in searching upstream for refs, but not for history. For example:</p> <pre><code>git ls-remote origin | egrep 'some_branch_name|merge' </code></pre> <p>will print refs on the remote that match the named branch you're looking for, or (in the case of GitHub) refs created from merged pull-requests such as:</p> <pre><code>381a77fd72ea594cfce5c82c845ad3d10bb87d71 refs/pull/99/merge </code></pre> <p>The <em>git-ls-remote</em> command displays refs available in a remote repository along with the associated commit IDs. However, if you want to find out what branch contains a given commit, you need access to the full history; that requires you to have a local copy.</p> <h3>Finding Branches Containing a Merge Commit</h3> <p>The best way I know to deal with this issue is the following:</p> <ol> <li>Fetch all branches with <code>git fetch --all origin</code>.</li> <li>Find the merge commits you want with <code>git log --merges</code>.</li> <li>Find the containing branches with <code>git branch --all --contains &lt;commit&gt;</code>.</li> </ol> <p>This will give you a list of branches that contain the specified commit.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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