前言
Githug (不是 Github )是一个用 Ruby 编写的、用来练习 Git 的闯关小游戏。在闯关过程中,我们可以掌握 Git 的基本用法、加深理解,同时提高熟练度。
闯关原则
在闯关过程中,要时刻明白,我们闯关的目的是学习 git ,所以请不要为了闯关而闯关,而忽略了闯关过程中的收获。我们的重点在于学习 Git 。
进行 Githug 前的准备
安装 Ruby
Ruby 是一种开源的动态编程语言。因为 Githug 是用 Ruby 写的,所以我们得先安装 Ruby (已安装则跳过此步)。Ruby 官网安装指引-https://www.ruby-lang.org/zh_cn/downloads/
Windows 用户可直接下载安装程序进行安装 :下载 Ruby 安装程序-https://rubyinstaller.org/downloads/
安装完后,打开命令行界面执行下列命令:
ruby --version
若输出有关 Ruby 的版本号,则代表安装成功。
安装 Githug
执行下列三行命令修改默认下载源:
//删除默认需要翻墙才能用的国外下载源 gem sources --remove https://rubygems.org/
//设置下载源为国内可以访问的下载源 gem sources --a https://gems.ruby-china.org/
//查看是否安装成功 gem sources -l
换源成功后执行下列命令安装 Githug
gem install githug
初始化 Githug
首先打开一个你想要建立 githug 游戏目录的文件夹,然后在资源管理器(暂时简单理解为文件夹的页面)的地址栏(有 "C:\windows\" 这样类似文字的编辑框)输入 cmd 回车。系统会自动打开位于当前路径下的 cmd 控制台,在这个命令行界面输入 githug ,返回的预期结果如下:
*********************************************************** * Githug *
*********************************************************** No githug directory
found, do you wish to create one? [yn]
这个提示的意思是你已经进入到 Githug 的游戏界面了,但是它未检索到游戏目录,提示你是否要建立目录。此时,输入字母 y 并按回车确认,它会在该文件夹下创建名为 git_hug 的游戏文件夹,然后用如下命令行进入到 git_hug 路径下就可以进行闯关了。
cd git_hug
常用的命令:
githug 或 githug play 检测当前关卡是否通过
githug hint 显示当前关卡的提示
githug reset 重置当前关卡
githug levels 列出所有关卡
注 · 在任意关卡退出后,再次进入 Githug ,闯关进度会保存
闯关指引
Level 1 init
Name: init Level: 1 Difficulty: * A new directory, `git_hug` , has been
created; initialize an empty repository in it.
Level 2
Level 3
Level 4
Level 5
Level 6
Level 7
Level 8
Level 9
Level 10
Level 11
Level 12
Level 13
Level 14
Level 15
Level 16
Level 17
Level 18
Level 19
Level 20
Level 21
Level 22
Level 23
Level 24
Level 25
Level 26
Level 27
Level 28
Level 29
Level 30
看得透又看得远者prevail. ppt.cc/flUmLx ppt.cc/fqtgqx ppt.cc/fZsXUx ppt.cc/fhWnZx ppt.cc/fnrkVx ppt.cc/f2CBVx
ppt.cc/fKlBax ppt.cc/fwlgFx ppt.cc/fVjECx ppt.cc/fEnHsx ppt.cc/fRZTnx ppt.cc/fSZ3cx ppt.cc/fLOuCx ppt.cc/fE9Nux ppt.cc/fL5Kyx ppt.cc/f71Yqx tecmint.com linuxcool.com linux.die.net linux.it.net.cn ostechnix.com unix.com ubuntugeek.com runoob.com man.linuxde.net ppt.cc/fwpCex ppt.cc/fxcLIx ppt.cc/foX6Ux linuxprobe.com linuxtechi.com howtoforge.com linuxstory.org systutorials.com ghacks.net linuxopsys.com ppt.cc/ffAGfx ppt.cc/fJbezx ppt.cc/fNIQDx ppt.cc/fCSllx ppt.cc/fybDVx ppt.cc/fIMQxx
Total Pageviews
Monday, 29 June 2026
Githug小白指南
Labels:
git
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment