Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
git-seminar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maximilian Konzack
git-seminar
Commits
9390e441
Verified
Commit
9390e441
authored
5 years ago
by
ck85nori
Browse files
Options
Downloads
Patches
Plain Diff
replaces checkout with switch and restore
fixes
#27
parent
f857f4ee
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
basics.html
+10
-7
10 additions, 7 deletions
basics.html
dia/rebase-vs-cherry-pick.dia
+17
-17
17 additions, 17 deletions
dia/rebase-vs-cherry-pick.dia
img/staging-area.dot
+1
-1
1 addition, 1 deletion
img/staging-area.dot
with
28 additions
and
25 deletions
basics.html
+
10
−
7
View file @
9390e441
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
dia/rebase-vs-cherry-pick.dia
+
17
−
17
View file @
9390e441
...
...
@@ -100,7 +100,7 @@
<dia:real
val=
"0.80000000000000004"
/>
</dia:attribute>
<dia:attribute
name=
"pos"
>
<dia:point
val=
"30,18.61
7
1"
/>
<dia:point
val=
"30,18.61
6
1"
/>
</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.25
2
5;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.84
75
"
/>
<dia:point
val=
"33,14.84
91
"
/>
</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.25
2
5;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.84
75
"
/>
<dia:point
val=
"38,14.84
91
"
/>
</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.25
2
5;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.84
75
"
/>
<dia:point
val=
"28,10.84
91
"
/>
</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.19
5
"
/>
<dia:point
val=
"51,12.19
41
"
/>
</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.25
2
5;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.84
75
"
/>
<dia:point
val=
"56,14.84
91
"
/>
</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.25
2
5;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.84
75
"
/>
<dia:point
val=
"61,14.84
91
"
/>
</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.91
62
,4.38
6
31;59.10
24
,7.58
988
"
/>
<dia:rectangle
val=
"52.91
75
,4.38
7
31;59.10
11
,7.58
819
"
/>
</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.25
2
5;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.84
75
"
/>
<dia:point
val=
"51,10.84
91
"
/>
</dia:attribute>
<dia:attribute
name=
"color"
>
<dia:color
val=
"#000000"
/>
...
...
This diff is collapsed.
Click to expand it.
img/staging-area.dot
+
1
−
1
View file @
9390e441
...
...
@@ -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"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment