Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is actually a command named git <a href="https://www.kernel.org/pub/software/scm/git/docs/git-cherry.html" rel="nofollow">cherry</a> that prints every commit that is not merged between two branches.</p> <p>For each printed commit, the "+" sign means you can merge it, the "-" sign means you already cherry-pick that commit.</p> <p>The output is far from being pretty.</p> <p>For those who came from SVN and are used to <a href="http://www.orcaware.com/svn/wiki/Svnmerge.py" rel="nofollow">svnmerge.py</a>, I made a "svnmerge avail -l" equivalent bash script for git, that I called gitavail:</p> <pre><code>#!/bin/bash # get current branch CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) # get tracked branch (1st argument), if no arg or arguments are only options, assume master if test -z $1 || grep -q '^-' &lt;&lt;&lt; $1; then TRACKED_BRANCH=master else TRACKED_BRANCH=$1; shift fi # Log commits available for merge from tracked branch LOG_OPTIONS=$* for i in $(git cherry $CURRENT_BRANCH $TRACKED_BRANCH | egrep '^\+' | awk '{print $2}'); do git --no-pager log -n1 $i ${LOG_OPTIONS}; echo; done </code></pre> <p>Assuming you are on a branch, and you want to list what is eligible to merge from master branch, just run:</p> <pre><code>gitavail --name-status </code></pre> <p>And you'll have an output very similar to "svnmerge avail -l".</p> <p>I guess the cherry-pick commits must not be manually modified (what about conflicts?), if the <a href="https://www.kernel.org/pub/software/scm/git/docs/git-patch-id.html" rel="nofollow">patch id</a> changes, git cherry won't realize the commit has already been cherry-picked.</p>
 

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