Created
March 20, 2016 10:24
-
-
Save NicolasGeraud/ef5dd9205aec64eded65 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
git filter-branch -f --env-filter ' | |
LANG=en_US.utf8 | |
original_git_date="$GIT_COMMITTER_DATE" | |
cutDate=$(echo $original_git_date | rev | cut -d" " -f2 |rev) | |
hour=$(date --date "$cutDate" +%H) | |
day=$(date --date "$cutDate" +%u) | |
new_git_date=$(date --date "$cutDate" +"%a %b %d %T %Y") | |
if [ "$hour" -gt "9" ] && [ "$hour" -lt "19" ] && [ "$day" -lt "6" ] | |
then | |
new_git_date=$(date --date "$new_git_date 9 hours" +"%a %b %d %T %Y %z") | |
fi | |
export GIT_AUTHOR_DATE="$new_git_date" | |
export GIT_COMMITTER_DATE="$new_git_date" | |
' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment