Githug第42关rebase_onto通关秘籍

简介: Githug是一个用来了解、熟悉Git的一个非常好的游戏。目前网站上收录的都是之前只有55关的解题方法,没有新增的rebase_onto这一关的内容。现在Githug一共有56关。

Githug是一个用来了解、熟悉Git的一个非常好的游戏。

目前网站上收录的都是之前只有55关的解题方法,没有新增的rebase_onto这一关的内容。现在Githug一共有56关。现将新增的42关的解答内容更新如下:

第42关的题目如下:

Name: rebase_onto
Level: 41
Difficulty: **

You have created your branch from `wrong_branch` and already made some commits, and you realise that you needed to create your branch from `master`. Rebase your commits onto `master` branch so that you don't have `wrong_branch` commits.

通过查找,在git rebase中有以下用法:

Here is how you would transplant a topic branch based on one branch to another, to pretend that you forked the topic
       branch from the latter branch, using rebase --onto.

       First let's assume your topic is based on branch next. For example, a feature developed in topic depends on some
       functionality which is found in next.

               o---o---o---o---o  master
                    \
                     o---o---o---o---o  next
                                      \
                                       o---o---o  topic

       We want to make topic forked from branch master; for example, because the functionality on which topic depends was
       merged into the more stable master branch. We want our tree to look like this:

               o---o---o---o---o  master
                   |            \
                   |             o'--o'--o'  topic
                    \
                     o---o---o---o---o  next

       We can get this using the following command:

           git rebase --onto master next topic

所以,第42关的通关方法如下:

 git rebase --onto master wrong_branch readme-update

祝通关顺利!

目录
相关文章
|
11月前
蓝桥杯真题代码记录(保险箱
蓝桥杯真题代码记录(保险箱
95 1
蓝桥杯真题代码记录(保险箱
|
11月前
|
人工智能 BI
leetcode代码记录(找到小镇的法官
leetcode代码记录(找到小镇的法官
70 0
|
11月前
蓝桥杯省赛冲刺(1 补充)考试流程 做题技巧 手算题 杂题
蓝桥杯省赛冲刺(1 补充)考试流程 做题技巧 手算题 杂题
92 0
|
11月前
第十四届蓝桥杯集训——JavaC组第十篇——分支语句
第十四届蓝桥杯集训——JavaC组第十篇——分支语句
69 0
|
11月前
|
Java C语言
第十四届蓝桥杯集训——JavaC组第十四篇——嵌套循环
第十四届蓝桥杯集训——JavaC组第十四篇——嵌套循环
94 0
通关《完蛋!我被LLM包围了! 》1~8关
欢迎来的“完蛋!我被LLM包围了”小游戏,《完蛋!我被LLM包围了!》是一款智力挑战游戏。该项目利用LLM, 基于ModelScope社区内现有的LLM对话Gradio应用程序代码,结合知乎文章《如何用“不可能”完成任务》中的预设问题,自动生成了对应的游戏代码,创造了一个独特的游戏体验。 在这个游戏中,玩家需要巧妙构造问题,挑战LLM给出满足特定条件的回答。(卡在第九关了一直过不去QAQ)
|
存储 机器学习/深度学习 算法
大逆不道,从天界偷下来的算法修仙秘籍竟然传到你手上~~(结尾有彩蛋)
这有可能是你见过最离谱的标题 这有可能是你没见过的技术文章模式 我不知道我的选择是否正确,但是我的想法就是: 不再让技术冷冰冰,让所有人学习中获得快乐!
314 1
|
安全 前端开发 C语言
带你读书之“红宝书”:第十章 函数⑥
带你读书之“红宝书”:第十章 函数⑥
101 0
带你读书之“红宝书”:第十章 函数⑥
|
JavaScript 前端开发
不看后悔系列!原来代码还可以这么写!
不看后悔系列!原来代码还可以这么写!
|
C语言
《C游记》 第二章 - 初识分支句 循环助本心(贰)
《C游记》 第二章 - 初识分支句 循环助本心(贰)
140 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等