L'environnement de travail : Un shell Linux : Bash avec git installé , soit sur votre système natif Linux ou dans un Linux installé sur Windows 10 avec WSL
Faites ces commandes dans l'ordre
cd <un répertoire de votre choix>
vous pouvez faire un copy/paste à partir de cette étape
# N'exécutez pas cette première ligne si vous ne voulez pas recommencer depuis le début
rm -rf CommitBranchEtMergeGR/ # pour recommencer si vous le souhaitez
git init CommitBranchEtMergeGR
cd CommitBranchEtMergeGR
echo "Un fichier initial" > README.md
git add README.md
git commit -m "Premier commit de l’épisode 4"
# Fin de l'étape de création du premier commit
Vous pouvez pour analyser ce que l'on à obtenu faire les commandes suivantes
git log --graph
git ls-files --stage
git cat-file -p master # cat-file : plomberie
git cat-file -p master^{tree}
# et le contenue de certains fichiers ou répertoire .git
more .git/HEAD
more .git/refs/heads/master
ls -R .git/objects
git show master # show : porcelaine
git show master^{tree}
git status
ls
git branch newbranch
git branch
more .git/HEAD
git checkout newbranch
git branch
more .git/HEAD
more .git/refs/heads/newbranch
git cat-file -t 78d066dbaba7b
git cat-file -t newbranch
git show newbranch
echo "deuxième fichier" > fichier2.txt
git add fichier2.txt
git commit -m "Un commit dans newbranch"
git branch
git log
more .git/refs/heads/newbranch
more .git/refs/heads/master
more .git/HEAD
git log --graph
git log --graph --all
git checkout master
git log --graph --all
git log --graph
git log --graph --all
echo "un fichier dans le contexte master" > f3.txt
git add .
git commit -m "dans master"
git log --graph
git log --graph --all
git cat-file -p 78d066dbaba
git cat-file -p newbranch
git cat-file -p master
git cat-file -p master^{tree}
git cat-file -p newbranch^{tree}
git branch
git merge newbranch
git log --graph --all
git -d newbranch
git branch -d newbranch
git log --graph --all
ls .git/refs/heads/
ls .git/objects/
ls .git/objects/30/