Samuel066
亲测爆肝git游戏通关攻略,史上最快,希望能够帮助到你们。
Learng git baranching: https://learngitbranching.js.org/?locale=zh_CN

基础篇
1.git commit
git commit

git commit

2.git branch
git branch bugFix

git checkout bugFix

3.git merge
git branch bugFix

git checkout bugFix

git commit -m “commit bugFix”

git checkout main

git commit -m “commit main”

git merge bugFix

4.git rebase
git branch bugFix

git checkout bugFix

git commit -m “bugFix”

git checkout main

git commit -m “main commit”

git checkout bugFix

git rebase main

高级篇
1.分离HEAD
git checkout c4

2.相对引用(^)
git checkout main^

git checkout c3

3.相对引用2(~)
git branch -f main c6

git checkout HEAD~1

git branch -f bugFix HEAD~1

4.撤销变更
git reset HEAD~1

git chekout pushed

git revert HEAD

移动提交记录
1.git cherry-pick
git cherry-pick c3 c4 c7

2.交互式rebase
git rebase -i overHere (打开控制面板)

omit c2 (点击c2)

c4 c5交换位置 (拉取)

杂项
1.只取一个提交记录
git checkout main

git cherry-pick c4

2.提交的技巧#1
git rebase -i HEAD~2 交换2和3的位置

git commit --amend

git rebase -i HEAD~2 恢复2和3的位置

git checkout mian

git rebase caption main

3.提交的技巧#2
git checkout main

git cherry-pick c2

git commit --amend

git cherry-pick c3

4.git tag
git tag v0 c1

git tag v1 c2

git checkout c2

5. git descride
git commit

高级话题
1.多次rebase
git rebase main bugFix

git rebase bugFix side

git rebase side another

git rebase another main

2.两个父节点
git branch bugWork main^ ^ 2^

3.纠缠不清的分支
git checkout one

git cherry-pick c4 c3 c2

git checkout two

git cherry-pick c5 c4 c3 c2

git branch -f three c2

Push & Pull —— Git 远程仓库!
1.git clone
git clone

2.远程分支
git commit

git checkout o/main

git commit

3.git fetch
git fetch

4.git pull
git pull

5.模拟团队合作
git clone

git fakeTeamwork 2

git commit

git pull

6.git push
git commit

git commit

git push

7.偏离的提及历史
git clone

git fakeTeamwork

git commit

git pull --rebase

git push

8.锁定的main(locked main)
git reset --hard o/main

git checkout -b feature c2

git push origin feature

关于 origin 和它的周边 —— Git 远程仓库高级操作
1.推送主分支
git fetch

git rebase o/main side1

git rebase side1 side2

git rebase side2 side3

git rebase side3 main

git push

2.合并远程仓库
git checkout main

git pull

git merge side1

git merge side2

git merge side3

git push

3.远程追踪
git checkout -b side o/main

git commit

git pull --rebase

git push

4.git push的参数
git push origin main

git push origin foo

5.git push的参数2
git push origin main^:foo

git push origin foo:main

6.git fetch的参数
git fetch origin main~1:foo

git fetch origin foo:main

git checkout foo

git merge main

7.没有source的source
git fetch origin :bar

git push origin :foo

8.git pull的参数
git pull origin bar:foo

git pull origin main:side

链接:https://blog.csdn.net/cj66666666666/article/details/124364424

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐