How to save multiple versions of a file

Hello! I’m new to GitHub, and although I’ve run through the beginner tutorials I’m a little hazy on how the whole thing works.

I’m developing my first webpage and decided to use Version Control for the first time. I want to upload the different versions of my webpage code to GitHub so I can track my programming jouney.

E.g. I want to have Webpage stage 1, then when I edit it a bit I want to upload Webpage stage 2 etc.

How would I do this?

Thank you in advance! : )

Have you taken a look at the GitHub Learning Lab? It has step-by-step tutorials for learning a lot of things about GitHub, including how to make changes and store them.

The basic workflow for making local changes to files that you have in a Git repository though is:

  1. Make your changes using whatever editor you use
  2. Stage your changes using the git add command
  3. Commit your changes using the git commit command

That’s all there is to it :grinning: Every time you commit your changes, that’s a different version of the project.

As a side note, it is important to understand that when you commit, you’re, in essence, creating a new version of the entire project, not simply one file. At least, it’s better to think of it that way.

I hope that helps!

1 Like