DEV Community

Discussion on: What is your favourite Git command?

Collapse
 
hamstu profile image
Hamish Macpherson
git nevermind

It's not a real git command, but it's an alias to wipe out any uncommitted changes, new files, etc. Basically gets you back to a clean state (i.e., the the last commit.) I do it all the time! (Warning: there's no going back once you run it though!)

This is how to set it up in your ~/.gitconfig:

[alias]
nevermind = !git reset --hard HEAD && git clean -d -f

Collapse
 
munamohamed94 profile image
Muna Mohamed

Ooo, that's an interesting one! Very fitting alias too, haha šŸ˜„! Will have to add that one to the toolbox šŸ‘šŸ¾. Thanks, Hamish!

Collapse
 
hamstu profile image
Hamish Macpherson

Glad you like it Muna! I love the name too, it always matches how I'm feeling when I run it. šŸ˜…

Collapse
 
hayderimran7 profile image
Imran Hayder

haha good one :D