Administrator@BGUJ9QLXIRFWC3SMINGW32 /d/gittest
$ mkdir my_stuffAdministrator@BGUJ9QLXIRFWC3SMINGW32 /d/gittest
$ cd my_stuff/Administrator@BGUJ9QLXIRFWC3SMINGW32 /d/gittest/my_stuff
$ git init
Initialized empty Git repository inD:/gittest/my_stuff/.git/Administrator@BGUJ9QLXIRFWC3SMINGW32 /d/gittest/my_stuff (master)
$ git status
On branch masterInitial commitnothing to commit (create/copy files and use "git add" to track)Administrator@BGUJ9QLXIRFWC3SMINGW32 /d/gittest/my_stuff (master)
$ echo "New data" > dataAdministrator@BGUJ9QLXIRFWC3SMINGW32 /d/gittest/my_stuff (master)
$ git status
On branch masterInitial commitUntrackedfiles:(use "git add <file>..." to includein what will be committed)datanothing added to commit but untracked files present (use "git add" to track)
git status報告一個未追蹤的文件。
Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/my_stuff (master)
$ touch main.oAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/my_stuff (master)
$ git status
On branch masterInitial commitUntracked files:(use "git add <file>..."toincludein what will be committed)datamain.onothing added to commit but untracked files present (use "git add"to track)Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/my_stuff (master)
$ echo main.o > .gitignoreAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/my_stuff (master)
$ git status
On branch masterInitial commitUntracked files:(use "git add <file>..."toincludein what will be committed).gitignoredatanothing added to commit but untracked files present (use "git add"to track)Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/my_stuff (master)
$
Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest
$ mkdir commit-all-exampleAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest
$ cd commit-all-example/Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example
$ git init
Initialized empty Git repository in D:/gittest/commit-all-example/.git/Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ echo something >> readyAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ echo something else >> notyetAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ git add readty notyet
fatal: pathspec 'readty' did notmatchany filesAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ git add ready notyet
warning: LF will be replaced by CRLF in notyet.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in ready.
The file will have its original line endings in your working directory.Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ git commit -m "Setup"
[master (root-commit) 599023e] Setup2 files changed, 2 insertions(+)create mode 100644 notyetcreate mode 100644 readyAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ git status
On branch master
nothing tocommit, working tree cleanAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ vim readyAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ git add ready
warning: LF will be replaced by CRLF in ready.
The file will have its original line endings in your working directory.Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ vim notyetAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ mkdir subdirAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ echo Nope >> subdir/newAdministrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ git status
On branch master
Changes to be committed:(use "git reset HEAD <file>..."to unstage)modified: readyChanges not staged forcommit:(use "git add <file>..."toupdate what will be committed)(use "git checkout -- <file>..."to discard changes in working directory)modified: notyetUntracked files:(use "git add <file>..."to include in what will be committed)subdir/Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ git commit -all
error: did you mean `--all` (with two dashes ?)Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ git commit --all
warning: LF will be replaced by CRLF in notyet.
The file will have its original line endings in your working directory.
[master 5b37342] yes2 files changed, 2 insertions(+), 2 deletions(-)Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$ git status
On branch master
Untracked files:(use "git add <file>..."to include in what will be committed)subdir/nothing added tocommit but untracked files present (use "git add"to track)Administrator@BGUJ9QLXIRFWC3S MINGW32 /d/gittest/commit-all-example (master)
$