Lost on the first commit section in the tutorial

Hi, I’m learning how to use github with command lines. I’m currently at step 5 of “Introduction to GitHub flow”. I don’t understand how to do #2 and #3. For now I bypassed it by using the web UI to commit a new file just to advance in the course, but I really wish to learn how to do it via command lines.

  1. Check out to your branch:
    git checkout my-slide

  2. Create a new file named ‘_posts/0000-01-02-nanashin404.md’.

  3. Add the following content to your file:
    — layout: slide title: “Welcome to our second slide!” — Your text Use the left arrow to go back!

  4. Stage your new file:
    git add _posts/0000-01-02-nanashin404.md

Thanks a lot for your help!

Hi @nanashin404! It looks like you made it past this step, but here are a few tips for doing this on the command line. Some different command lines do things differently, so if these don’t work for you, I’d recommend googling the specific tasks one at a time for your terminal.

  • You can find out what type of terminal you have by typing echo $SHELL
  • Step 2 had you create a new file, AND a new directory. To do this on my terminal, I would:
    • To create the new directory: mkdir _posts
    • To navigate into that directory: cd _posts
    • To create a new file within that directory: touch 0000-01-01-nanashin404.md
  • Step 3 had you add content to your new file. You can do this with your command line using something like Vim, but I would recommend using a text editor to edit and save the file.

I hope this helped!

Thanks for this explanation @brianamarie. I also got stuck at this point and it was not clear to me either… Could this step be clarified with possible links to the commands? This step was also a departure from previous ones that told the learner exactly what to do, so it could use improvement for that reason as well.

That’s a great idea! I am opening an issue in the course repository so that this suggestion is as discoverable as possible to course maintainers and any open source community members who may want to contribute by implementing these changes. Thank you!