Cheat Sheet

Line endings

Have current Sha1

Complet

git rev-parse HEAD

Court

git rev-parse --short HEAD

Change last commit author

git commit --amend --author="Author Name <email@address.com>"

Create branch with history of one subfolder

git subtree split --prefix=**folder_to_save** --branch=**new_branch_name**

Merge repositories and keep history

Clone repo

git clone --bare https://external-host.com/extuser/repo.git

cd repo.git
git push --mirror https://github.com/ghuser/repo.git

Delete all history

Step 1: remove all history (Make sure you have backup, this cannot be reverted)

cat .git/config  # note <github-uri>
rm -rf .git

Step 2: reconstruct the Git repo with only the current content

git init
git add .
git commit -m "Initial commit"

Step 3: push to GitHub.

git remote add origin <github-uri>
git push -u --force origin master