Created
January 9, 2015 17:34
-
-
Save probablycorey/9448f95d80b7bcafc5b6 to your computer and use it in GitHub Desktop.
How do I unstage a staged deletion?
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
# Assume my-file.txt has been commited previously | |
repo = Rugged::Repository.discover(some_dir) | |
File.delete("my-file.txt") | |
# This will stage the file deletion | |
repo.index.remove("my-file.txt") # This doesn't work | |
repo.index.write | |
# How do I "unstage" this deletion? | |
repo.index.add("my-file.txt") # This doesn't work... what will? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment