git workflow != svn workflow
(Pfff, quelle question !)
La terminologie (Console, Terminal, Shell, CLI)
La complétion
Terminologie :
$ git init test
Initialized empty Git repository in /tmp/test/.git/
$ cd test
$ find .git/objects
.git/objects
.git/objects/info
.git/objects/pack
$ echo 'Hello git!' | git hash-object --stdin
7a860024518c83a85d6e0292e3c3d749b509173e
$ echo 'Hello git!' | git hash-object -w --stdin
7a860024518c83a85d6e0292e3c3d749b509173e
$ git cat-file -t 7a860024518c83a85d6e0292e3c3d749b509173e
blob
$ git cat-file -s 7a860024518c83a85d6e0292e3c3d749b509173e
11
$ git cat-file -p 7a860024518c83a85d6e0292e3c3d749b509173e
Hello git!
$ ls .git/objects/*
.git/objects/7a:
860024518c83a85d6e0292e3c3d749b509173e
.git/objects/info:
.git/objects/pack:
$ git cat-file -p 796c1
tree cbe0780272b6cf0e141079b7e245f3eabac29a06
author Stanislas Ormières <stanislas.ormieres@smartfocus.com> 1436364788 +0200
committer Stanislas Ormières <stanislas.ormieres@smartfocus.com> 1436364788 +0200
First Commit
$ git cat-file -p cbe07
100644 blob 557db03de997c86a4a028e1ebd3a1ceb225be238 README.md
040000 tree db78f3594ec0683f5d857ef731df0d860f14f2b2 new_dir
$ git cat-file -p 557db
Hello World
$ git cat-file -p db78f
100644 blob 557db03de997c86a4a028e1ebd3a1ceb225be238 README.md
$ tree
.
├── new_dir
│ └── README.md
└── README.md
Modification
Staging (add)
Commit
Modification
Staging (add)
Commit
reset/co
&& add
Unstaging (reset)
checkout
Une "branche" dans Git :
Conséquences :
git commit --amend
git rebase -i <SHA-1>
git commit --fixup/squash <old SHA-1> && git rebase -i --autosquash <older SHA-1>
git reset <old SHA-1> && git cherry-pick <SHA-1> / git commit
tag simple