base git commands

  • git init (initialize on empty git repository)
  • git status (show the working tree status)
  • git add (add file contents to the index)
  • git rm (Remove files from the working tree and from the index)
  • git restore (Restore working tree files)
  • git commit (Records the change to repository)
  • git log (show commit logs)

git Low Level Commands

  • git cat-file
    • -t (git object type)
    • -s (git object size)
    • -p (git object content)
  • git ls-files
    • -s (Show staged contents’s mode bits, object name and stage number in the out put)
  • git diff

    • —cached 将索引区与 git 仓库做对比
    • 输出中的:@@ -1,16 +1,16 @@ 代表代码块,‘-’开头代表索引区,‘+’开头代表工作区; 1 表示从第一行开始,16 表示向下数16行。 ``` zhanyeye@NUC:~/git-demo$ git diff diff —git a/README.md b/README.md index a3f6af0..5a58519 100644 —- a/README.md +++ b/README.md @@ -1,16 +1,16 @@

      base git commands

      -git init (initialize on empty git repository) -git status (show the working tree status) -git add (add file contents to the index) -git rm (Remove files from the working tree and from the index) -git restore (Restore working tree files) -git commit (Records the change to repository) -git log (show commit logs) + git init (initialize on empty git repository) + git status (show the working tree status) + git add (add file contents to the index) + git rm (Remove files from the working tree and from the index) + git restore (Restore working tree files) + git commit (Records the change to repository) +* git log (show commit logs)

    git Low Level Commands

    -git cat-file —t (git object type) —s (git object size) —p (git object content) -git ls-files —s (Show staged contents’s mode bits, object name and stage number in the out put) \ No newline at end of file + git catfile

  • -t (git object type)
  • -s (git object size)
  • -p (git object content) + git lsfiles
  • -s (Show staged contents’s mode bits, object name and stage number in the out put) \ No newline at end of file ```

image.png

image.png