Created
May 22, 2014 01:40
-
-
Save monmon/d5c7a1f784818225abe6 to your computer and use it in GitHub Desktop.
git rm でファイルを削除した時、そのファイルがあったディレクトリが空になるならば、そのディレクトリごと削除される
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
[10:37] ~/tmp/2014-05-22/test | |
% git --version | |
git version 1.9.0 | |
[10:37] ~/tmp/2014-05-22/test | |
% git init | |
Initialized empty Git repository in /Users/no-kumagai/tmp/2014-05-22/test/.git/ | |
[10:37] ~/tmp/2014-05-22/test | |
(git)-[master]-% ll | |
[10:37] ~/tmp/2014-05-22/test | |
(git)-[master]-% mkdir -p path/to/ | |
[10:37] ~/tmp/2014-05-22/test | |
(git)-[master]-% touch path/to/file | |
[10:37] ~/tmp/2014-05-22/test | |
(git)-[master]-% git add . | |
[10:37] ~/tmp/2014-05-22/test | |
(git)-[master]-% git ci -m 'first commit' | |
[master (root-commit) 7a78b7f] first commit | |
1 file changed, 0 insertions(+), 0 deletions(-) | |
create mode 100644 path/to/file | |
[10:37] ~/tmp/2014-05-22/test | |
(git)-[master]-% tree path | |
path | |
└── to | |
└── file | |
1 directory, 1 file | |
[10:37] ~/tmp/2014-05-22/test | |
(git)-[master]-% git rm path/to/file | |
rm 'path/to/file' | |
[10:37] ~/tmp/2014-05-22/test | |
(git)-[master]-% git st | |
On branch master | |
Changes to be committed: | |
(use "git reset HEAD <file>..." to unstage) | |
deleted: path/to/file | |
[10:37] ~/tmp/2014-05-22/test | |
(git)-[master]-% git ci -m 'delete file' | |
[master 2b96e76] delete file | |
1 file changed, 0 insertions(+), 0 deletions(-) | |
delete mode 100644 path/to/file | |
[10:38] ~/tmp/2014-05-22/test | |
(git)-[master]-% tree path | |
path [error opening dir] | |
0 directories, 0 files | |
[10:38] ~/tmp/2014-05-22/test | |
(git)-[master]-% ll | |
[10:38] ~/tmp/2014-05-22/test | |
(git)-[master]-% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment