DEV Community

Cover image for 2nd day as a developer:
Rebecca-254
Rebecca-254

Posted on

2nd day as a developer:

undestanding version control with git ang git hub

the second day i went a step ahead into something I had heard about a lot but never really understood: version control.

At first, it sounded like a scary technical thing. But once I read more about it, I realized… it’s basically just a smart way to save and track your work.


So what is version control
I understood version control as a system that helps developers keep track of changes in their code over time. It helps in;

  1. Save every change you make
  2. Go back to older versions if something breaks
  3. Work on projects without messing up the main one
  4. Collaborate with other developers safely

Tools Learned

Git
Git tracks your changes locally and is installed in computer as i did in my previous article.

GitHub

Tis is the cloud platform where your Git-tracked projects can be uploaded, shared, and collaborated on with others.

in other words
Git = Your notebook
GitHub = The cloud where you back it up and share with friends

Basic Git terms

Repo: A Git folder/project
Commit: A saved change with a message
Branch: A copy of your code to test new things
Push: Upload to GitHub
Pull: Download from GitHub

for further understanding ; https://about.gitlab.com/topics/version-control/


This is what i tried

-Created a test project folder using git bash by running the following command

mkdir my-besquat-project
cd my-besquat-project

then created a ripo named besquat in GitHub

this is what i saw after creating my repository

then ran this on git
git init
git add .
git commit -m "my first commit"
git remote add origin https://github.com/Rebecca-254/my-besquat-project.git
git branch -M main
git push -u origin main

It took a few tries, but when I saw my code on GitHub, I was proud

struggles
-confused between Git and GitHub😂
-My push failed because I hadn’t set up the remote URL correctly

What i learned

  1. Git is like “Save with notes”
  2. GitHub is where your saved work lives online
  3. Version control isn’t hard — it just takes practice

Top comments (0)