Last active
December 12, 2020 10:08
-
-
Save ViktorHofer/6d24f62abdcddb518b4966ead5ef3783 to your computer and use it in GitHub Desktop.
Update PRs with files changed in src/coreclr/src/*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BACKUP your repo before doing this in case something goes wrong | |
# This isn't tested with commit ranges that include merge commits. Use with caution! | |
# Requires a Unix shell terminal | |
# REPLACE #START_COMMIT# with the SHA of the commit BEFORE (parent of) your first commit that you want to update. | |
# You need to git push --force to your branch after you validated that the commits are correct. | |
# Usage example: | |
# cd runtime | |
# vi script.sh (add content) | |
# chmod +x rewrite.sh | |
# Replace #START_COMMIT# with the SHA before your first commit. | |
# ./rewrite.sh | |
# rm rewrite.sh | |
# Validate changes in the tree! | |
# git push -f (to your branch!) | |
git filter-branch --index-filter ' | |
git ls-files -s | | |
perl -0pe "s{src/coreclr/src}{src/coreclr}" | | |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info && | |
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE | |
' -f -- #START_COMMIT#..HEAD |
No, that command should be executed outside of any (pending) rebase operation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do I want to start a rebase before using this?