category
3/24/2017 - 6:08 AM

Lifesaver Git Commands

Lifesaver Git Commands

Remove file from git repo

check tracked files

git ls-tree --full-tree -r master

remove file from history

git filter-branch --tree-filter 'rm  file'

check tracked files for removal

git ls-tree --full-tree -r master

Rename lastest pushed commit

Make sure no one else has pushed or will push before you do this:

git commit --amend
git push origin +master

Push to git using specific ssk key

ssh-agent bash -c 'ssh-add /path/to/.ssh/id_rsa; git push origin HEAD'