Skip to content

Instantly share code, notes, and snippets.

@madhavtummala
Last active September 13, 2019 06:16
Show Gist options
  • Save madhavtummala/f1927effbc960071818f1e868a9bd069 to your computer and use it in GitHub Desktop.
Save madhavtummala/f1927effbc960071818f1e868a9bd069 to your computer and use it in GitHub Desktop.
#!/bin/bash
COPY_REPO="https://github.com/apsknight/IITBBSNewsAPI.git"
TARGET_REPO="https://github.com/MadhavChoudhary/IITBBSNewsAPI.git"
START_DATE="28-07-2019"
git clone $COPY_REPO
cd $(basename "$COPY_REPO" .git)
X=$(date +%s)
Y=$(date -jf %d-%m-%Y $START_DATE +%s)
D=$(((X-Y)/86400))
git filter-branch -f --env-filter '
MY_NAME="MadhavChoudhary"
MY_EMAIL="[email protected]"
SYM="d"
RAND=$(($RANDOM % 3))
OFFSET=${OFFSET:-'$D'}
OFFSET=$((OFFSET-RAND))
DATE=$(date -v -$OFFSET$SYM -R)
export GIT_AUTHOR_NAME="$MY_NAME"
export GIT_AUTHOR_EMAIL="$MY_EMAIL"
export GIT_COMMITTER_NAME="$MY_NAME"
export GIT_COMMITTER_EMAIL="$MY_EMAIL"
export GIT_AUTHOR_DATE="$DATE"
export GIT_COMITTER_DATE="$DATE"
' HEAD
git remote remove origin
git remote add origin $TARGET_REPO
git push -f origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment