downgoon / hello-world

hello-world for anything you want on branches or subdir
25 stars 5 forks source link

写在前面的话

这是一个教程项目。它跟通常的教程有些不同

通常教程以博客的形式展现,好的博客编辑器还支持“代码样式”(这点比“代码截图”年代强多了),作者可以把关键代码片段放入代码区(例如Markdown编辑器以``一行代码``符号表示一行代码,以```多行代码```表示多行代码)。

但是为了重现作者的示例代码运行过程,人们往往需要从博客中拷贝代码片段,并在IDE中编写其他代码。


这个过程很浪费时间。于是笔者发起这个hello-world项目,想做到几点:


使用步骤

克隆/拉取/下载spring-config分支到本地:

$ git clone -b spring-config https://github.com/downgoon/hello-world.git

或者 (先克隆主干,然后拉取spring-config分支)

$ git clone https://github.com/downgoon/hello-world.git
$ git checkout -b spring-config origin/spring-config

当然如果一开始只拉取了master,再拉取其他分支:

$ git clone https://github.com/downgoon/hello-world.git
$ git fetch origin
$ git checkout spring-config

通过 commit log 查询知识点,并checkout 进入指定的点:

$ git log --grep="spring-config" -n 1

commit a730c52de03965fd304eb0e0dc57ffe298131344
Author: downgoon <downgoon@qq.com>
Date:   Sat Jan 14 16:52:27 2017 +0800

    spring-config-c5-confmulti

$ git checkout a730c52de0

如果作者打了tag,还可以通过以下指令列出所有以spring-config开头的tag,然后checkout 进入:

$ git tag --list "spring-config*"
spring-config-c1-annotation
spring-config-c2-twobeans
spring-config-c3-fileconf
spring-config-c4-confbyenc
spring-config-c5-confmulti

$ git checkout spring-config-c4-confbyenc

注意事项