Git
Page content
Some Git Commands
Merge two Repos “merge unrelated histories”
git pull origin master --allow-unrelated-histories
git push
git pull
add local Folder and Push to Upstream
echo "# test" >> README.md
git init
git config init.defaultBranch main
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:stoege/test.git
git push -u origin main
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
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
Remove last Commit
will remove the last Commit from your current branch
git reset --soft HEAD~1
sha256: 9eedfe15d3b39bea752347225095102d5b50645926c26ac777e8c6488f2f7529