Record updates (檢測更新) Back

1. Files' Status

2. Check the status of files

$ git status
On branch master
nothing to commit, working directory clean
  • 當前分支: master
  • 沒有文件需要提交
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        README

nothing added to commit but untracked files present (use "git add" to track)
  • README沒有被跟蹤
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:   benchmarks.rb
  • benchmarks.rb已進行修改, 但沒進入緩存區

3. Add files into staged area

$ git add benchmarks.rb

4. Ignore some files

$ cat .gitignore

5. Find the differences of a modified file

$ git diff

6. Commit the update

  • 提交前要確保所有新建或修改過的文件都git add
git commit

7. Skip the staged area and commit

  • 跳過緩存, Git自動把所有已跟蹤過的文件暫存起來一起提交
$ git add -a -m 'added new benchmarks'

8. Delete a file

$ git rm README

9. Rename a file

$ git mv README README.txt
Empty Comments
Sign in GitHub

As the plugin is integrated with a code management system like GitLab or GitHub, you may have to auth with your account before leaving comments around this article.

Notice: This plugin has used Cookie to store your token with an expiration.