git add
git add
的意義就是要把檔案交給Git,並且讓Git開始追蹤這個檔案$ git add Hello.txt
git status
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: Hello.txt
git add *.txt
git add .
或者是 git add --all
Hello world!
,現在我們把它改成Hello world to you
git status
,看看有什麼變化吧!On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: Hello.txt
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: Hello.txt
git add Hello.txt
n branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: Hello.txt
今天先講到這邊,明天再來討論add完之後要幹嘛!!