如何在Git中创建带有快照的编码教程 [英] How to create a coding tutorial with snapshots in Git

查看:68
本文介绍了如何在Git中创建带有快照的编码教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Angular Tutorial 显示了该技术的实际应用。教程追随者的体验是:


  1. 首先,复制存储库。
  2. 接下来,检查然后按照本教程中步骤1的说明进行操作。
  3. 接下来,检查步骤2, 继续执行步骤2中的步骤。 b $ b

    开始Angular Tutorial的终端命令为:

      git clone git://github.com/ angular / angular-phonecat.git 
    cd angular-phonecat
    git checkout -f step-0

    最棒的是你可以直接跳到你想要的任何一步,然后从那里开始。



    如何设计这种类型的教程体验?这种方法有哪些最佳做法?是否有可能返回并编辑特定的步骤而不影响前后的其他内容? 首先考虑你的教程中的每一步。然后开发一步并提交。然后编写教程的这一部分。然后转到下一节,编码,提交,写入,重复!



    只要返回而不影响其他部分,您就不会内在地能够从你的回购中的独立头部犯下。你必须从前一个位置分出来。但老实说,这可能会更好的用户。



    这实际上是一个非常酷的想法。但我认为non-git用户需要一个关于在提交之间移动的入门教程(checkout)

    The Angular Tutorial shows the technique in action. The experience for the tutorial follower is:

    1. First, clone the repository.
    2. Next, check out step 1 to get the repo into the appropriate state.
    3. Then follow the instructions for step 1 in the tutorial.
    4. Next, check out step 2.
    5. Follow the instruction for step 2.
    6. Continue.

    The terminal commands to begin the Angular Tutorial are:

    git clone git://github.com/angular/angular-phonecat.git
    cd angular-phonecat
    git checkout -f step-0
    

    What's great about this is that you skip straight to any step you want and start from there.

    How does one go about designing this type of tutorial experience? What are some best practices for this method? Is it possible to go back and edit a particular step without affecting others that come before or after it?

    解决方案

    i would say to start by thinking about each step in your tutorial. then doing the development for one step and commit it. then write that section of the tutorial. then move on to the next section, code it, commit it, write it, REPEAT!

    as far as going back w/o effecting others, you will not intrinsically be able to commit from a detached head in your repo. you'd have to branch out from that previous position. but honestly that might be better for users.

    this is actually a pretty cool idea. but i would think that non-git users would need a primer tutorial about moving between commits (checkout)

    这篇关于如何在Git中创建带有快照的编码教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆