Skip to content

Instantly share code, notes, and snippets.

@cheshire137
Created September 24, 2015 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cheshire137/4e80b9034e84a0283cf7 to your computer and use it in GitHub Desktop.
Save cheshire137/4e80b9034e84a0283cf7 to your computer and use it in GitHub Desktop.
Get cherry-pick commands for shas linked on a Github page
// 1. Go to a URL like https://github.com/my-org/my-repo/pull/1/commits
// 2. Open up your browser JavaScript console.
// 3. Paste the command below.
// Now you have git cherry-pick commands for making a branch of those commits!
var commands = '';jQuery('a.sha').each(function() { var url = $(this).attr('href'); var sha = url.split('/commit/')[1]; commands += 'git cherry-pick ' + sha + "\n"; }); console.log(jQuery.trim(commands));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment