Git

Page content

Some Git Commands

Merge two Repos “merge unrelated histories”

git pull origin master --allow-unrelated-histories
git push
git pull

### Find deleted File

git log --diff-filter=D --summary

commit abcecadce91af3814662fa6a04d0f12e361f0574
Date:   Sun May 31 23:19:59 2020 +0200

    update

 delete mode 100644 master/sed.tcpdump

commit 81ae58d70c27d02eb2f65beed4fe0b571073f087
Date:   Fri May 29 16:06:14 2020 +0200

    update

Restore deleted File

git checkout 81ae58d70c27d02eb2f65beed4fe0b571073f087 sed.tcpdump

Remove Sensitive Data

https://help.github.jp/enterprise/2.11/user/articles/removing-sensitive-data-from-a-repository/

git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch .geheimesfile' \
--prune-empty --tag-name-filter cat -- --all

git push origin --force --all

git push origin --force --tags

sha256: fd74de4918390644e46dffe29a434eb74ba892dd138003a20cb234cce418676e