Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

super easy to clear all work with git clear #583

Closed
JWesorick opened this issue Sep 22, 2016 · 3 comments
Closed

super easy to clear all work with git clear #583

JWesorick opened this issue Sep 22, 2016 · 3 comments

Comments

@JWesorick
Copy link

JWesorick commented Sep 22, 2016

I often type clear in my terminal to clear it out. Sometimes I might even hit enter twice. Today I typed git clear and hit enter twice. It proceeded to undo all of my work. What the heck. If this command needs to exist can it at least require you to type in "yes" or anything at all. It would have saved me many hours of doing work twice. Thanks.

git-extras/bin/git-clear


#!/usr/bin/env bash

echo "Sure? - This command may delete files that cannot be recovered, including those in .gitignore [Y/n]"
read ans
if [ "$ans" != "n" ] 
    then git clean -d -f -x && git reset --hard
fi
@JWesorick
Copy link
Author

@grindhold

@grindhold
Copy link
Contributor

sorry for your inconvenience. ↑ has been patched.

@JWesorick
Copy link
Author

Thanks!

richardfearn added a commit to richardfearn/git-extras that referenced this issue Nov 19, 2016
6d49449 changed the git-clear default option to "no" (see tj#583).

Make the git-clear-soft default the same - it's safer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants