Skip to content

Instantly share code, notes, and snippets.

@PiDayDev
Last active July 22, 2024 20:12
Show Gist options
  • Select an option

  • Save PiDayDev/68c39b305ab9d61ed8bb2a1195ee1afc to your computer and use it in GitHub Desktop.

Select an option

Save PiDayDev/68c39b305ab9d61ed8bb2a1195ee1afc to your computer and use it in GitHub Desktop.

Revisions

  1. PiDayDev revised this gist Oct 13, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion cherry-picky.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,8 @@
    #!/usr/bin/env bash

    # Usage: ./cherry-pick <commit SHA or tag>
    # Will cherry-pick given commit, but only committing files in "src/" folder and skipping the rest
    # It will cherry-pick given commit, but will only commit files in "src/" folder, skipping the rest.
    # Bonus: the commit message and authorship information including the timestamp are copied from cherry-picked commit
    # Credits to https://stackoverflow.com/a/5717615/7193150

    git cherry-pick -n $1
  2. PiDayDev created this gist Oct 13, 2018.
    11 changes: 11 additions & 0 deletions cherry-picky.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #!/usr/bin/env bash

    # Usage: ./cherry-pick <commit SHA or tag>
    # Will cherry-pick given commit, but only committing files in "src/" folder and skipping the rest
    # Credits to https://stackoverflow.com/a/5717615/7193150

    git cherry-pick -n $1
    git reset HEAD
    git add src/
    git checkout .
    git commit -C $1