美文网首页
Githug第42关rebase_onto通关秘籍

Githug第42关rebase_onto通关秘籍

作者: Sahadev | 来源:发表于2018-01-23 15:13 被阅读71次

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

祝通关顺利!

相关文章

  • Githug第42关rebase_onto通关秘籍

    Githug是一个用来了解、熟悉Git的一个非常好的游戏。 目前网站上收录的都是之前只有55关的解题方法,没有新增...

  • GitHug 通关指南

    本文首发于 https://blog.lenconda.top/posts/2018/05/31/githug_g...

  • GitHug 通关攻略(用来练习你的git技能)

    Githug ?对,你没看错!!不是 GitHub,是GitHug。那么他跟 Git 什么关系? 和游戏又有什么关...

  • Git学习之----Githug通关(1--20关)

    1.init 2.config 3.add 4.commit 5.clone 6.clone_to_folder ...

  • 【羊了个羊】iPhone关卡快速通关

    羊了个羊第二关通关秘籍 本项目旨在为你快速通关羊了个羊,上手需要一定动手能力以及门槛,【必要】电脑 (Window...

  • 「Githug」Git 游戏通关流程

    Githug 他喵的这是个啥!?难道不是 GitHub 拼错了么,和 Git 什么关系? 和游戏又有什么关系? 其...

  • 每天一本书之第七天

    《出奇制胜》 (669字) 1.超级马里奥兄弟通关秘籍 内特的马里奥奔跑不止,他先完成1,1关,然后在1.2关的天...

  • 通关git抱抱

    'githug'是一个跟'learnyournode'差不多的通关github,在浪费了一个可以看电影的下午,我把...

  • 科目三通关秘籍

    注意:挂三档后,全程保持在25码左右的速度,时刻观察路况,有任何意外情况,先踩离合,再踩刹车。 秘诀:胆大心细,能...

  • 通关秘籍

    恍恍惚惚 红红火火 哼哼哈嘿 卿卿我我 上上下下 左左右右 ABAB XXOO 前前后后 嘿咻嘿咻 哼哼唧唧 颤颤抖抖

网友评论

      本文标题:Githug第42关rebase_onto通关秘籍

      本文链接:https://www.haomeiwen.com/subject/xwpsaxtx.html