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

祝通关顺利!

目录
相关文章
|
存储 缓存 安全
90%的Go语言程序员map遍历方式都是错的
90%的Go语言程序员map遍历方式都是错的
1223 0
|
存储 应用服务中间件 nginx
使用filebeat简单收集多个nginx应用服务器日志(一)
使用filebeat简单收集日志 1.filebeat原理与介绍 filebeat收集日志的原理类似于tail -f命令,等待应用日志产生后,每隔30s将日志进行收集,收集完成后存放在es的索引库中,最后展示在kibana上
2196 0
使用filebeat简单收集多个nginx应用服务器日志(一)
|
9月前
|
人工智能 JavaScript Python
搞定这两个工具,让你玩转AI的效率翻倍!
环境配置不是技术,而是生产力!本文揭秘AI开发两大“护法”:uv(Python环境管理神器,秒装多版本、告别pip地狱)和nvm(Node.js版本自由切换),助你5分钟搞定环境,把时间留给创造,而非报错调试。
862 3
|
Linux 数据安全/隐私保护 Windows
Linux共享Windows目录
Linux共享Windows目录
|
缓存 前端开发 Java
SpringBoot 实现动态菜单功能完整指南
本文介绍了一个动态菜单系统的实现方案,涵盖数据库设计、SpringBoot后端实现、Vue前端展示及权限控制等内容,适用于中后台系统的权限管理。
1341 1
|
SQL JSON 数据库
influxdb 端点使用http进行sql查询,写数据
influxdb 端点使用http进行sql查询,写数据
1397 0
|
存储 SQL Rust
[译] Python各版本的主要更改
[译] Python各版本的主要更改
728 1
|
运维 监控 NoSQL
客户说|莉莉丝《剑与远征:启程》引入阿里云MongoDB,助力游戏高效开发
客户说|莉莉丝《剑与远征:启程》引入阿里云MongoDB,助力游戏高效开发
892 1
|
Web App开发 前端开发 JavaScript
《手把手教你》系列技巧篇(二十)-java+ selenium自动化测试-元素定位大法之终卷(详细教程)
【4月更文挑战第12天】本文介绍了Selenium的八种元素定位方式,包括id、name、class name、css selector、link text、partial link text、tag name和xpath,并给出了每种方式的示例代码。建议在选择定位方法时,优先使用唯一性的id和name,其次考虑css或xpath,但要注意它们的性能影响。
769 6
|
开发工具 git 开发者
git rebase的使用
通过这些思维导图和分析说明表,您可以更直观地理解Git rebase的概念、用法和应用场景。希望本文能帮助您更高效地使用Git rebase,提高代码管理的效率和质量。
3384 13