Created
July 16, 2014 23:52
-
-
Save nlindley/49f2316d7c7d1de9cc63 to your computer and use it in GitHub Desktop.
Script to remove untracked files in a git repository.
This file contains hidden or 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
#!/bin/bash | |
git status -su | cut -d' ' -f2- | tr '\n' '\0' | xargs -0 rm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use:
$PATH
. I have mine in~/bin
.chmod +x ~/bin/git-rmu
git rmu
.If you want the command to be something different, then just rename the file. If you would rather type
git removeuntrackedfilesyesiamsure
, then rename the filegit-removeuntrackedfilesyesiamsure
.