Git snippet: Cleaning and migrating a repo

Below is a snippet which I used when I was migrating some legacy code to GitHub. SRC_URL= DEST_URL= FOLDER_NAME= # deep clone (mirror) git clone --mirror $SRC_URL $FOLDER_NAME # backup tar cvzf ${FOLDER_NAME}.tar.gz $FOLDER_NAME # see if there are any big or unnecessary files in whole repoe history cd $FOLDER_NAME git rev-list --all | xargs … Continue reading Git snippet: Cleaning and migrating a repo