Qndev’s blog

About me Logo

View the Project on GitHub qndev/qndev.github.io

19 March 2019

My git notes - File Status LifeCyle

by NGUYEN DINH QUANG

Một số câu lệnh cơ bản thông qua trạng thái của file/tập tin trong repository

File Status LifeCyle

Tạo thư mục làm việc của dự án với câu lệnh: mkdir < tên thư mục >.

VD:
     * mkdir git
     * Tiếp theo di chuyển vào thư mục git vừa tạo: cd git
     * Khởi tạo repository: git init.
     * Hiển thị thông tin về repository vừa tạo: git status
On branch master

    Initial commit

    nothing to commit (create/copy files and use "git add" to track)
On branch master

    Initial commit

    Untracked files:
     (use "git add <file>..." to include in what will be committed)

    git-repository

    nothing added to commit but untracked files present (use "git add" to track)

On branch master

Initial commit

Changes to be committed:
(use "git rm --cached <file>..." to unstage)

 new file: git-repository

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: git-repository

git checkout -- <file name> # Loại bỏ các thay đổi trước đó.
git reset HEAD <file name> # Loại bỏ tập tin ra khỏi khu vực staging area.

Latest Posts

tags: