preloader

Shell script to git cherry pick multiple commits

Create .sh file and copy the below script and run.
Note that the commitcode.txt should be the path to a text file containing hash code of commits (first 7 code), the commit code should be one below the other.

#!/bin/bash
commits=$(<~/home/commitcode.txt)
git fetch –all
for commitcodes in $commits
do
git cherry-pick $commitcodes
git push
done


Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *