diff --git a/basics.html b/basics.html index b77e4cb078898d0113f4c625926be9f2c304647f..b7d54546a97e64dd99dbc5eed97101be8286c30d 100644 --- a/basics.html +++ b/basics.html @@ -348,6 +348,9 @@ 1. install git CLI 1. open terminal 1. type: `git version` + + notes: + - we **need** git 2.23 for `git switch` and `git restore` </section> </section> @@ -575,7 +578,7 @@ git unstage file # discard changes - git checkout file + git restore file # rename and remove git mv source destination @@ -862,7 +865,7 @@ git branch name # switch to a branch - git checkout name + git switch name ``` notes: @@ -870,7 +873,7 @@ # branch, branch --all git lol # show branches # branch wip/feature, lol - # checkout wip/feature, lol + # switch wip/feature, lol # edit, commit, lol # push, lol ``` @@ -903,7 +906,7 @@ ```bash # resolve branch by merging - git checkout master + git switch master git merge branch-name # delete branch @@ -912,7 +915,7 @@ notes: ``` - # checkout master, lol + # switch master, lol # merge wip/feature, lol # branch -d wip/feature, lol ``` @@ -1006,7 +1009,7 @@ ```bash git remote add alice https://... git fetch alice - git checkout master + git switch master git merge alice/topic/feature # fix conflicts git push @@ -1016,7 +1019,7 @@ ```bash git fetch upstream - git checkout topic/feature + git switch topic/feature git merge origin/master # fix conflicts git push diff --git a/dia/rebase-vs-cherry-pick.dia b/dia/rebase-vs-cherry-pick.dia index 9ffd0f24b24bccd785f6fc7468a6a2a5830a6dbc..d26a219d7687f6471857a5973e74f3bac1a3f063 100644 --- a/dia/rebase-vs-cherry-pick.dia +++ b/dia/rebase-vs-cherry-pick.dia @@ -100,7 +100,7 @@ <dia:real val="0.80000000000000004"/> </dia:attribute> <dia:attribute name="pos"> - <dia:point val="30,18.6171"/> + <dia:point val="30,18.6161"/> </dia:attribute> <dia:attribute name="color"> <dia:color val="#000000"/> @@ -194,7 +194,7 @@ <dia:point val="33,15"/> </dia:attribute> <dia:attribute name="obj_bb"> - <dia:rectangle val="32.8075,14.2525;33.1925,15"/> + <dia:rectangle val="32.8075,14.255;33.1925,15"/> </dia:attribute> <dia:attribute name="text"> <dia:composite type="text"> @@ -208,7 +208,7 @@ <dia:real val="0.80000000000000004"/> </dia:attribute> <dia:attribute name="pos"> - <dia:point val="33,14.8475"/> + <dia:point val="33,14.8491"/> </dia:attribute> <dia:attribute name="color"> <dia:color val="#000000"/> @@ -227,7 +227,7 @@ <dia:point val="38,15"/> </dia:attribute> <dia:attribute name="obj_bb"> - <dia:rectangle val="37.8075,14.2525;38.1925,15"/> + <dia:rectangle val="37.8075,14.255;38.1925,15"/> </dia:attribute> <dia:attribute name="text"> <dia:composite type="text"> @@ -241,7 +241,7 @@ <dia:real val="0.80000000000000004"/> </dia:attribute> <dia:attribute name="pos"> - <dia:point val="38,14.8475"/> + <dia:point val="38,14.8491"/> </dia:attribute> <dia:attribute name="color"> <dia:color val="#000000"/> @@ -290,7 +290,7 @@ <dia:point val="33,5"/> </dia:attribute> <dia:attribute name="obj_bb"> - <dia:rectangle val="30.8137,4.38631;35.2049,6.78988"/> + <dia:rectangle val="30.8137,4.40594;35.1863,6.75094"/> </dia:attribute> <dia:attribute name="text"> <dia:composite type="text"> @@ -343,7 +343,7 @@ git rebase b c#</dia:string> <dia:point val="28,11"/> </dia:attribute> <dia:attribute name="obj_bb"> - <dia:rectangle val="27.8075,10.2525;28.1925,11"/> + <dia:rectangle val="27.8075,10.255;28.1925,11"/> </dia:attribute> <dia:attribute name="text"> <dia:composite type="text"> @@ -357,7 +357,7 @@ git rebase b c#</dia:string> <dia:real val="0.80000000000000004"/> </dia:attribute> <dia:attribute name="pos"> - <dia:point val="28,10.8475"/> + <dia:point val="28,10.8491"/> </dia:attribute> <dia:attribute name="color"> <dia:color val="#000000"/> @@ -408,7 +408,7 @@ git rebase b c#</dia:string> <dia:real val="0.80000000000000004"/> </dia:attribute> <dia:attribute name="pos"> - <dia:point val="51,12.195"/> + <dia:point val="51,12.1941"/> </dia:attribute> <dia:attribute name="color"> <dia:color val="#000000"/> @@ -502,7 +502,7 @@ git rebase b c#</dia:string> <dia:point val="56,15"/> </dia:attribute> <dia:attribute name="obj_bb"> - <dia:rectangle val="55.8075,14.2525;56.1925,15"/> + <dia:rectangle val="55.8075,14.255;56.1925,15"/> </dia:attribute> <dia:attribute name="text"> <dia:composite type="text"> @@ -516,7 +516,7 @@ git rebase b c#</dia:string> <dia:real val="0.80000000000000004"/> </dia:attribute> <dia:attribute name="pos"> - <dia:point val="56,14.8475"/> + <dia:point val="56,14.8491"/> </dia:attribute> <dia:attribute name="color"> <dia:color val="#000000"/> @@ -535,7 +535,7 @@ git rebase b c#</dia:string> <dia:point val="61,15"/> </dia:attribute> <dia:attribute name="obj_bb"> - <dia:rectangle val="60.8075,14.2525;61.1925,15"/> + <dia:rectangle val="60.8075,14.255;61.1925,15"/> </dia:attribute> <dia:attribute name="text"> <dia:composite type="text"> @@ -549,7 +549,7 @@ git rebase b c#</dia:string> <dia:real val="0.80000000000000004"/> </dia:attribute> <dia:attribute name="pos"> - <dia:point val="61,14.8475"/> + <dia:point val="61,14.8491"/> </dia:attribute> <dia:attribute name="color"> <dia:color val="#000000"/> @@ -598,14 +598,14 @@ git rebase b c#</dia:string> <dia:point val="56,5"/> </dia:attribute> <dia:attribute name="obj_bb"> - <dia:rectangle val="52.9162,4.38631;59.1024,7.58988"/> + <dia:rectangle val="52.9175,4.38731;59.1011,7.58819"/> </dia:attribute> <dia:attribute name="text"> <dia:composite type="text"> <dia:attribute name="string"> <dia:string>#cherry-pick -git checkout b +git switch b git cherry-pick a...c#</dia:string> </dia:attribute> <dia:attribute name="font"> @@ -652,7 +652,7 @@ git cherry-pick a...c#</dia:string> <dia:point val="51,11"/> </dia:attribute> <dia:attribute name="obj_bb"> - <dia:rectangle val="50.8075,10.2525;51.1925,11"/> + <dia:rectangle val="50.8075,10.255;51.1925,11"/> </dia:attribute> <dia:attribute name="text"> <dia:composite type="text"> @@ -666,7 +666,7 @@ git cherry-pick a...c#</dia:string> <dia:real val="0.80000000000000004"/> </dia:attribute> <dia:attribute name="pos"> - <dia:point val="51,10.8475"/> + <dia:point val="51,10.8491"/> </dia:attribute> <dia:attribute name="color"> <dia:color val="#000000"/> diff --git a/img/staging-area.dot b/img/staging-area.dot index 450e98f978fdba038b3bc3a060d3617bebaab4bc..fc54af2c71b8f78743571af34382ee81e53a2f4a 100644 --- a/img/staging-area.dot +++ b/img/staging-area.dot @@ -13,7 +13,7 @@ digraph { workdir -> stage [label = "git stage file"] stage -> workdir [label = "git unstage file"] - # workdir -> discard [label = "git checkout"] + # workdir -> discard [label = "git restore"] # untracked -> discard [label = "rm"] stage -> repo [label = "git commit"]