@lihautan
https://lihautan.com
Web Frontend - Platform
https://youtu.be/vpFKAV1Zy5Y
# in Branch A
git checkout branch-a
git merge master
# or
git merge --ff master
# in Branch A
git checkout branch-a
git merge master
# or
git merge --no-ff master
= git fetch origin branch-a
+ git merge origin/branch-a
= git fetch origin branch-a
+ git merge origin/branch-a
= git fetch origin branch-a
+ git merge origin/branch-a
git push origin branch-a
git reset --hard branch-a
git reset --hard branch-a
git reset --hard #d
git reset --hard #d
git cherry-pick branch-a
git cherry-pick branch-a
git cherry-pick branch-c
git cherry-pick branch-c
git revert #1
git revert #1
master: git revert #1
master: git revert #1
feat/a: git merge master
feat/a: git merge master
master: git merge feat/a
master: git merge feat/a
feat/a: git merge master
feat/a: git merge master
feat/a: git revert ~#1
feat/a: git revert ~#1
master: git merge feat/a
master: git merge feat/a
branch-a branched out from master
# in Branch A
git checkout branch-a
git rebase master
# in Branch A
git checkout branch-a
git rebase --onto branch-b master branch-a
# in Branch A
git checkout branch-a
git rebase --onto branch-b master
# in Branch A
git checkout branch-a
git rebase --onto branch-b #1
#1
# in Branch A
git checkout branch-a
git rebase --onto #1 #1
#1
# in Branch A
git checkout branch-a
git rebase #1
#1
#1
#1
git rebase -i #1
#2 pick commit msg 2
#3 pick commit msg 3
#4 pick commit msg 4
#5 pick commit msg 5
#6 pick commit msg 6
#1
git rebase -i #1
# Rebase #1..#6 onto #1 (5 commands)
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
...
#1
git rebase -i #1
#2 pick commit msg 2
#3 drop commit msg 3
#4 pick commit msg 4
#5 pick commit msg 5
#6 pick commit msg 6
#1
git rebase -i #1
#2 pick commit msg 2
#3 drop commit msg 3
#4 pick commit msg 4
#5 pick commit msg 5
#6 pick commit msg 6
#1
git rebase -i #1
#2 pick commit msg 2
#3 squash commit msg 3
#4 pick commit msg 4
#5 fixup commit msg 5
#6 pick commit msg 6
#1
git rebase -i #1
#2 pick commit msg 2
#3 squash commit msg 3
#4 pick commit msg 4
#5 fixup commit msg 5
#6 pick commit msg 6
#1
git rebase -i #1
#2 pick commit msg 2
#3 pick commit msg 3
break
#4 pick commit msg 4
#5 pick commit msg 5
#6 pick commit msg 6
#1
git rebase -i #1
#2 pick commit msg 2
#3 pick commit msg 3
break
#4 pick commit msg 4
#5 pick commit msg 5
#6 pick commit msg 6
#1
git rebase -i #1
Stopped at #3... commit msg 3
$ git status
interactive rebase in progress; onto 594531e
Last commands done (2 commands done):
...
(see more in file .git/rebase-merge/done)
Next commands to do (3 remaining commands):
...
#1
git rebase -i #1
...
$ git add .
$ git commit -m "commit msg 3.1"
#1
git rebase -i #1
...
$ git add .
$ git commit -m "commit msg 3.1"
#1
git rebase -i #1
$ git rebase --continue
#1
git rebase -i #1
$ git rebase --continue
#1
git rebase -i #1
#2 pick commit msg 2
#3 edit commit msg 3
#4 pick commit msg 4
#5 pick commit msg 5
#6 pick commit msg 6
#1
git rebase -i #1
...
$ git add .
$ git rebase --continue
#1
git rebase -i #1
...
$ git add .
$ git rebase --continue
#1
git rebase -i #1
#2 pick commit msg 2
#3 reword commit msg 3
#4 pick commit msg 4
#5 pick commit msg 5
#6 pick commit msg 6
#1
git rebase -i #1
# abort
$ git rebase --abort
# continue
$ git rebase --continue
= git fetch origin branch-a
+ git merge origin/branch-a
= git fetch origin branch-a
+ git rebase origin/branch-a
= git fetch origin branch-a
+ git rebase origin/branch-a
aliased to glol
$ git bisect start $ git bisect bad v2.5.1 $ git bisect good v2.6.13
$ git bisect start $ git bisect bad v2.5.1 $ git bisect good v2.6.13
Bisecting: 675 revisions left to test after this (roughly 10 steps)
$ git bisect start $ git bisect bad v2.5.1 $ git bisect good v2.6.13
Bisecting: 675 revisions left to test after this (roughly 10 steps)
$ git bisect good
$ git bisect start $ git bisect bad v2.5.1 $ git bisect good v2.6.13
Bisecting: 675 revisions left to test after this (roughly 10 steps)
$ git bisect good
Bisecting: 337 revisions left to test after this (roughly 9 steps)
$ git bisect start $ git bisect bad v2.5.1 $ git bisect good v2.6.13
Bisecting: 675 revisions left to test after this (roughly 10 steps)
$ git bisect good
Bisecting: 337 revisions left to test after this (roughly 9 steps)
$ git bisect bad
$ git bisect start $ git bisect bad v2.5.1 $ git bisect good v2.6.13
Bisecting: 675 revisions left to test after this (roughly 10 steps)
$ git bisect good
Bisecting: 337 revisions left to test after this (roughly 9 steps)
$ git bisect bad
Bisecting: 168 revisions left to test after this (roughly 8 steps)
$ git bisect start $ git bisect bad v2.5.1 $ git bisect good v2.6.13
Bisecting: 675 revisions left to test after this (roughly 10 steps)
$ git bisect good
Bisecting: 337 revisions left to test after this (roughly 9 steps)
$ git bisect bad
Bisecting: 168 revisions left to test after this (roughly 8 steps)
$ git bisect reset