Skip to content

Instantly share code, notes, and snippets.

@madagra
Created January 4, 2022 16:43
Show Gist options
  • Save madagra/346b6fc7f6b05cc6d9a28a397be81299 to your computer and use it in GitHub Desktop.
Save madagra/346b6fc7f6b05cc6d9a28a397be81299 to your computer and use it in GitHub Desktop.
Select commits for cherry-picking
#!/bin/bash
# select a list of commits starting from head and put the in a file
# this is useful when selecting a set of commits to cherry-pick
git log --oneline | head -25 | tac | awk '{print $1}' | sed ':label1 ; N ; $! b label1 ; s/\n/\ /g' > commits.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment