shell-whiz-toolkit/git
2024-10-15 09:59:09 +09:00
..
gi.sh add things resources from the last 5 years over machines 2024-10-15 09:59:09 +09:00
gitpass.sh add things resources from the last 5 years over machines 2024-10-15 09:59:09 +09:00
README.md add things resources from the last 5 years over machines 2024-10-15 09:59:09 +09:00

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


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