Skip to content

Instantly share code, notes, and snippets.

@masak
Created October 17, 2013 12:24
Show Gist options
  • Save masak/7023973 to your computer and use it in GitHub Desktop.
Save masak/7023973 to your computer and use it in GitHub Desktop.
Example of a current directory being removed when the last file in it is 'git rm'-ed
/tmp $ git init example
Initialized empty Git repository in /tmp/example/.git/
/tmp $ cd example
/tmp/example $ mkdir foo
/tmp/example $ touch foo/bar
/tmp/example $ git add foo/bar
/tmp/example $ git commit -m 'add foo/bar'
[master (root-commit) 4fce4e5] add foo/bar
0 files changed
create mode 100644 foo/bar
/tmp/example $ cd foo
/tmp/example/foo $ git rm bar
rm 'foo/bar'
/tmp/example/foo $ git status
fatal: Unable to read current working directory: No such file or directory
/tmp/example/foo $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment