1 of 15

GitHub

Web Technology

2 of 15

  • Tracks how files change over time—and who changed them.
  • Lets you compare versions, restore earlier work, and investigate bugs.
  • Supports parallel work without emailing files like final_v7_reallyfinal.zip.
  • Git is the version-control tool; GitHub hosts Git repositories and adds collaboration features.

K1

Why version control?

3 of 15

  • Working directory: files you are editing now.
  • Staging area: selected changes prepared for the next snapshot.
  • Repository: committed history stored in Git.
  • A commit is a named snapshot—not simply a save button.

K1

Git mental model: three places

4 of 15

  • git init — create a repository in the current folder
  • git status — see changed, staged, and untracked files
  • git add <file> — stage a change
  • git commit -m "Describe change" — save a snapshot
  • git log --oneline — inspect commit history

K1

Essential Git commands

5 of 15

K1

A first local workflow

6 of 15

K1

Git vs. GitHub

7 of 15

K1

Create your first local repository

8 of 15

K1

Connect your local project to GitHub

9 of 15

K1

Useful commands to remember

10 of 15

K1

Branches: work without breaking main

  • Keep the main branch in a stable, usable state.
  • Create a feature branch for one task, such as feature/login or fix/navbar.
  • Commit the work on that branch and push it to GitHub.
  • Open a Pull Request (PR) to propose merging the work into main.
  • Review the changes, run tests, resolve conflicts if needed, and merge.

11 of 15

K1

Pull Requests, Issues, and README

  • Pull Request: discuss and review proposed code changes before merging.
  • Issue: track a bug, feature request, task, or question.
  • README.md: explain what the project does and how to install/run it.
  • Use meaningful commit messages and small, focused Pull Requests.
  • Assign reviewers and describe what changed and how you tested it.

12 of 15

K1

A good student project repository

README: overview, setup, usage, screenshots.

.gitignore: exclude generated files and local secrets.

tests: keep test cases with the code.

LICENSE: clarify reuse rights when publishing.

13 of 15

K1

Avoid these common mistakes

  • Do not upload passwords, API keys, private keys, or database dumps.
  • Do not commit huge generated folders, build output, or virtual environments.
  • Do not use unclear messages like “update” or “final final”.
  • Do not overwrite teammates’ work without checking changes first.
  • Check university rules before publishing coursework, datasets, or collaborators’ code.
  • If a secret is exposed, revoke/rotate it immediately—deleting the line is not enough.

14 of 15

K1

Git Flow

15 of 15

THANK YOU

Slide Credit: Subin Sahayam, Assistant Professor,

Department of Computer Science and Engineering

Shiv Nadar University