Git and GitHub for Web Designers: Commits, Branches, Merging, Pull Requests and a Safe Daily Workflow

Web Designing 55 min min read Updated: Nov 17, 2026 Beginner
Git and GitHub for Web Designers: Commits, Branches, Merging, Pull Requests and a Safe Daily Workflow
Beginner Topic 1 of 3

Why Version Control?

Git saves snapshots (commits) of your project so you can go back, compare and work in parallel. GitHub is a website that stores Git projects online and helps teams review work.

First Setup (Once)

bash git config --global user.name "Your Name" git config --global user.email "you@example.com"

Core Commands

CommandWhat it does
git initStart tracking a folder
git statusSee what changed
git add .Stage all changes for the next commit
git commit -m "message"Save a snapshot with a message
git log --onelineSee history in short form
git switch -c nameCreate and move to a new branch
git merge nameBring a branch into the current one
git push and git pullSend to and receive from GitHub

A Real Session

We ran these commands in an empty test folder. Your commit codes will be different.

bash git init -b main echo "<h1>Hi</h1>" > index.html git status --short git add . git commit -m "Add home page" git switch -c feature/menu echo "<nav></nav>" >> index.html git commit -am "Add nav" git switch main git merge feature/menu git log --oneline git branch
Result

status: ?? index.html | log: 65ee38c Add nav, then a67994b Add home page (hashes differ on your computer) | branches: feature/menu and * main

Good Commit Messages

  • Short, present tense: 'Add contact form'
  • One purpose per commit
  • Commit often, push at least daily

.gitignore

text node_modules/ .DS_Store .env dist/ *.log
Secrets Never commit passwords, API keys or .env files. If it happens, treat the secret as leaked and replace it.

Branch Workflow

  1. Update main: git switch main then git pull
  2. Create a branch for one task: git switch -c feature/hero
  3. Work and commit
  4. Push the branch: git push -u origin feature/hero
  5. Open a pull request on GitHub for review
  6. After approval, merge it and delete the branch

Connect to GitHub

bash git remote add origin https://github.com/YOUR-NAME/my-site.git git push -u origin main
Undo safely git restore file.html discards unsaved changes to a file. git revert <commit> makes a new commit that undoes an old one without rewriting history.

Practice

  1. Put your portfolio project under Git with three commits
  2. Create a branch, make a change and merge it
  3. Push to GitHub and open a pull request in a practice repository

Conclusion

Git keeps your history, branches let you try ideas safely and GitHub adds backup and teamwork. Commit small, write clear messages and never commit secrets.

Quick Summary: Why; setup; commands; session; messages; gitignore; workflow; remote.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators