Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 995 Bytes

git-commands-more.md

File metadata and controls

69 lines (51 loc) · 995 Bytes

Commands

Initialization

$ mkdir /tmp/git
$ cd /tmp/git
$ git init .
Initialized empty Git repository in /tmp/git/.git/
$ tree -aF -I 'description|hooks|info'
$ echo 'Arbitrary text' > file1.txt

no changes, changes submitted manually by git commands

$ tree -aF -I 'description|hooks|info'

Prepare to save changes

$ git add file1.txt
$ tree -aF -I 'description|hooks|info'

new files .git/index - to list all the files changed .git/objects/8e/4b04b468c5350cad218004489cc896e80df946

$ git ls-files --stage
$ git cat-file -t <hash>
$ git cat-file <type> <hash>

blob - binary large object

File status tracking

$ echo 'Arbitrary text' > file2.txt
$ git status
$ git commit -m <message>
$ git cat-file -t <commit-id>
$ git cat-file commit <commit-id>
$ git cat-file -t <tree-id>
$ git cat-file -p <tree-id>

Git tacks time, owner, access changes (filesystem).