Thứ Hai, 16 tháng 6, 2014

Git Basic

Record change to the repository

As we add or modify a file, Git sees them as modified or new file. After added / modified, we have to stage the modified file and commit it to Git repository.


The lifecycle of the status of your files.

Some basic command in Git

  1. git status : to check status of file
  2. git add <file name>: to tracking a new or modified file.
  3. git commit:  commit new / modified file to Git database.
  4. git diff: To see what you have changed.  Note: git diff  just show the change when the file not yet staged. To see what you have change in staged, use git diff --cached
  5. git rm: remove the file from repository and working directory. To remove file only in repository (untracked file) . Use: git rm --cahed