Programación Para Tontos

Git

Git and GitHub for beginners: a drama-free guide

Learn what Git is, what GitHub is, and the three commands you'll use 90% of the time.

Git is a tool that saves the history of changes to your code, like a giant "Ctrl+Z" with superpowers. GitHub is a website where you can store that history in the cloud and share it with others.

The three commands you'll use most

git add .
git commit -m "Explain what you changed"
git push
  1. git add . — marks the files you changed to be saved.
  2. git commit -m "..." — saves a "snapshot" of those changes with a message.
  3. git push — uploads that snapshot to GitHub so it's backed up.

Why should I use Git from the start?

  • You can undo mistakes without fear.
  • You can see exactly what changed and when.
  • It's the standard way programming teams work.

Your first repository

  1. Create a folder for your project.
  2. Run git init inside it.
  3. Create a GitHub account and a new repository.
  4. Follow GitHub's instructions to connect your local folder to the remote repository.

You don't need to understand everything at once. With these three commands you can already start versioning your projects.