Github
Migrations: https://help.github.com/enterprise/2.11/admin/guides/migrations/
mirroring: https://help.github.com/articles/duplicating-a-repository/
https://help.github.com/articles/about-github-mirrors/
clean history
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA' \
--prune-empty --tag-name-filter cat -- --all
p4merge
https://gist.github.com/tony4d/3454372
bots and push
mirror
count lines of code
git ls-files | xargs wc -l
monitoring
https://github.com/vegasbrianc/github-monitoring - grafana montioring
hooks
https://github.com/typicode/husky/issues/124 - skipping hooks for CICD
migrating directories with history
http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/
DESTINATIONPATH=~/tmp/mergepatchs
SOURCE=node
git format-patch -o $DESTINATIONPATH --root $SOURCE
cd to new repo
git checkout -b init
SOURCE=node
git am --ignore-space-change --ignore-whitespace --3way $DESTINATIONPATH/*.patch
fix diverged histories
git fetch upstream
git branch -u upstream/master
git rebase --onto upstream/master
# or
git pull --allow-unrelated-histories upstream master
restore deleted file
https://stackoverflow.com/questions/953481/find-and-restore-a-deleted-file-in-a-git-repository?rq=1
git rev-list -n 1 HEAD -- <path>
git checkout <deleting_commit>^ -- <file_path>
# git checkout $(git rev-list -n 1 HEAD -- "$file")^ -- "$file"
# git checkout $(git rev-list -n 1 HEAD -- "$file")~1 -- "$file"