Skip to content

Latest commit

 

History

History
129 lines (111 loc) · 3.99 KB

File metadata and controls

129 lines (111 loc) · 3.99 KB

Week 1 - Introduction, Github, Command Line

We might not get through everything, but we'll get as far as we can.

What You'll Learn

  • What different programming languages are for and how they work together
  • How to use the command line to execute some basic commands on your computer
  • How to publish up a website you made from scratch using Github pages
  • How to follow the same workflow as professional developers when coding (and why they do things this way)

If You Know Github and the Command Line Already...

  • Come up with a project that you'd like to work on for the next 2-3 weeks. Could be something that works well with your other classes. Should definitely be something you don't already know how to do, and I'll guide you through it.

Today's Session

Installs and Account Creation

  1. Create a new account on Github.
  2. Install and setup Git and SSH Keys.

Git vs. Github

What is Git?

  • Version control for coders
    • Why do coders need version control?
      • Sometimes your code just breaks and you need to go back
      • Collaboration
      • Think of it like "track changes" or "revision history"

What is Github?

  • Graphical web service that helps people use git, plus some other nice features
  • Why would anyone use it?
    • Creators:
      • Version control
      • Collaboration
      • Sharing with the world
      • Free web hosting
      • Project management extras (issues, milestones, etc.)
    • Users:
      • Access open-source projects and libraries
      • Contribute to projects online (pull request)

Who uses it?

How does Github work exactly?

Four basic commands to sync the code on our computer to the repository hosted on Github

git status
git add .
git commit -m "Updated design"`
git push

Creating 'branches' and using a branch called 'gh-pages' to create our own website

git branch
git branch gh-pages
git checkout gh-pages
git push origin gh-pages

What else is possible? Github's excellent cheatsheet. They also have a tutorial.

Command Line Basics

But before we try any of these commands themselves, we need to know some Command line basics.

Command Example What it does Notes
pwd pwd Shows your present working directory Useful for keeping track of where you are
ls ls Shows the contents of the current directory Can also use ls -a or ls -l to show more information about files
cd cd Desktop Changes directories Use cd ..``` to move backwards
mkdir mkdir new-directory Creates a new directory
touch touch test.py Creates a new file
mv mv test.py ./Desktop This isn't covered above, but mv moves or renames a file.
rm rm test.py Deletes a file Use with extreme caution. Once a file is deleted this way, you can't get it back.