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
git add .— marks the files you changed to be saved.git commit -m "..."— saves a "snapshot" of those changes with a message.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
- Create a folder for your project.
- Run
git initinside it. - Create a GitHub account and a new repository.
- 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.