Git Index


Git Index是工作目錄和倉庫的一個臨時區域,或者稱之為暫存區域。你可以用這個Index去建立你要一起提交的變更。當你做一個Commit,這個Commit的當前是在Index的,而不是在工作目錄中內容。

要查看什么是Index,最好的辦法是用Git Status這條命令。這條顯示可以顯示哪些文件被staged(在index里面),哪些修改還沒有被staged,哪些還沒有被跟蹤。

$>git status
# On branch master
# Your branch is behind 'origin/master' by 11 commits, and can be fast-forwarded.
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   modified:   daemon.c
#
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
#   modified:   grep.c
#   modified:   grep.h
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   blametree
#   blametree-init
#   git-gui/git-citool

如果完全不要Index這個區域。你一般不會丟失任何信息,但是你必須得知道文件樹結構的名稱。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM