Last active
December 17, 2015 00:29
-
-
Save masak/5521876 to your computer and use it in GitHub Desktop.
git clean -dfx
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
/tmp $ git init repo1 | |
Initialized empty Git repository in /tmp/repo1/.git/ | |
/tmp $ cd repo1 | |
/tmp/repo1 $ git init repo2 | |
Initialized empty Git repository in /tmp/repo1/repo2/.git/ | |
/tmp/repo1 $ cd repo2 | |
/tmp/repo1/repo2 $ touch file1 | |
/tmp/repo1/repo2 $ git add file1 | |
/tmp/repo1/repo2 $ git commit -m 'add file1' | |
[master (root-commit) f6272b4] add file1 | |
0 files changed | |
create mode 100644 file1 | |
/tmp/repo1/repo2 $ cd .. | |
/tmp/repo1 $ echo repo2 > .gitignore | |
/tmp/repo1 $ git add .gitignore | |
/tmp/repo1 $ git commit -m 'ignore repo2' | |
[master (root-commit) 862f3b2] ignore repo2 | |
1 file changed, 1 insertion(+) | |
create mode 100644 .gitignore | |
/tmp/repo1 $ ls -l repo2/ | |
total 0 | |
-rw-r--r-- 1 masak masak 0 May 5 21:33 file1 | |
/tmp/repo1 $ git clean -dfx | |
Removing repo2/ | |
/tmp/repo1 $ ls -l repo2/ | |
total 0 | |
-rw-r--r-- 1 masak masak 0 May 5 21:33 file1 | |
/tmp/repo1 $ git --version | |
git version 1.7.10.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment