Created
September 9, 2023 15:16
-
-
Save jsyzdek/51f0cc93ff30e6625b556959a4a443b7 to your computer and use it in GitHub Desktop.
GIT reset current branch and remove untracked files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git clean is destructive, particularly if you have .env files | |
# and/or /vendor or /node_modules directories. | |
# Instead, use this to reset your current branch back before a pull or something. | |
# | |
# Personally, I keep this in my ~/.bashrc file so it's available on session boot. | |
alias gitr='git reset --hard && git ls-files --others --exclude-standard | xargs rm' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment