HeadlinesBriefing favicon HeadlinesBriefing.com

Step‑by‑Step Guide to Git and GitHub for Beginners

DEV Community •
×

Developers new to source management often hear talk of “pushing to main” without a clear picture. This DEV Community guide demystifies Git, the version control system that records every code change, and GitHub, the web‑based hosting service that stores those repositories in the cloud. Mastering them prevents accidental loss and enables collaboration.

First, Windows users download Git Bash from git‑scm.com and run the installer, keeping defaults such as the editor and initial branch name. Next, they configure their identity with `git config --global user.name` and email, then generate an SSH key via `ssh-keygen`. Adding the public key to GitHub’s SSH settings completes the handshake.

With the link established, a new folder becomes a repository via `git init`. Creating a file, then running `git add .` and `git commit -m` records a snapshot. `git push -u origin main` uploads it to GitHub, while `git pull origin main` syncs later changes. Repeating add‑commit‑push forms the core workflow for any project.