Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Process used to ammend a commit way back in my log (to eliminate some sensitive information)
- # Print the git log to a temp file
- git log --pretty=oneline > git.log
- git checkout -b new_branch SHA
- # edit and ammend
- git commit -a --amend
- # Use sed to reverse the lines in the file
- # Use awk to pull the first token (the commit)
- # Then loop over them all and cherry-pick one at a time
- for commit in `sed -n '1!G;h;$p' git.log | awk '{print $1 }'`
- do
- git cherry-pick $commit
- done
Add Comment
Please, Sign In to add comment