Created
March 26, 2012 22:06
-
-
Save schneems/2210123 to your computer and use it in GitHub Desktop.
Remove File from Git Branch
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
# If you just want to remove a file called '/test/unit/user_test.rb' from your current branch it would look like this: | |
# Be wary not to use the --all option if you only want to act on the current branch | |
$ git checkout master | |
$ git filter-branch --index-filter 'git rm --cached --ignore-unmatch test/unit/user_test.rb' --prune-empty | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment