git小游戏通关攻略(基础、高级、远程)

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

  • 0
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值