https://missing.csail.mit.edu/2020/version-control/
git init
git add *.py
git commit
git remote add origin <repourl here>
git push -u -f origin main
git pull origin main --allow-unrelated-histories
git checkout -b branchname
git branch --delete <branchname>
git revert --no-commit <commitid>
Note: On github, there is also a button which simply does that, completely without shell commands
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
git fetch upstream
# then: (like "git pull" which is fetch + merge)
git merge upstream/master master
# or, replay your local work on top of the fetched branch
# like a "git pull --rebase"
git rebase upstream/master