shell-whiz-toolkit/git/README.md
2025-01-01 17:55:26 -08:00

1.1 KiB

useful git stuff



reset all commits


check out to a temporary branch:
git checkout --orphan TEMP_BRANCH
add all the files:
git add -A
commit the changes:
git commit -am "(:"
delete the old branch:
git branch -D main
rename the temporary branch to main:
git branch -m main
finally, force update to our repository:
git push -f origin main


reverting back to an older commit


git reset --hard HEAD~N

or

git reset --hard COMMIT

and then

git push origin master --force


delete all local branches


git branch | grep -v "main" | xargs git branch -D 


troubleshooting


error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
git config http.postBuffer 524288000


setup notifications for commits


  • the simplest way is using a rss feed on this endpoint:
https://api.github.com/repos/<username>/<repo>/events