Sitemap
Geoff McCarron-Benson

Geoff McCarron-Benson

git nuke

--

Clean up my git repo and blow away all changes

As a windows batch file

gitnuke.bat

Get Geoff McCarron-Benson’s stories in your inbox

Join Medium for free to get updates from this writer.

git clean -df
git reset --hard

if exist .git/rebase-apply (
git rebase --abort
)
if exist .git/rebase-merge (
git rebase batch--abort
)

git status
git pull

As a git alias

~/.gitconfig

[alias]
nuke = "!f(){ git reset --hard; git clean -df; if [ -d ".git/rebase-apply" ] || [ -d ".git/rebase-merge" ]; then git rebase --abort; fi; git status; git pull; }; f"

--

--