Ravindra BagaleCourses & study guides मराठी

Ravi Sir's Cards › DevOps

Chapter 2: Git, GitHub and Git Bash: Cards

मराठी cards · Open the chapter

Revision cards

Why Git: zip folders vs history. Copying folders loses track of who changed what and why.
Revision card 1 of 13: Why Git: zip folders vs history · Download PNG · Open card page

Lesson: 2.1 Why Git — zip folders vs history

Git vs GitHub vs Git Bash. Beginners think these three are one thing.
Revision card 2 of 13: Git vs GitHub vs Git Bash · Download PNG · Open card page

Lesson: 2.2 Git vs GitHub vs Git Bash

Repository, remote and origin. These words appear in every Git command and error.
Revision card 3 of 13: Repository, remote and origin · Download PNG · Open card page

Lesson: 2.3 Repository, remote and origin

Install, check and first vocabulary. Commits without a name and email look anonymous and confuse teams.
Revision card 4 of 13: Install, check and first vocabulary · Download PNG · Open card page

Lesson: 2.4 Install check and first vocabulary

init, status, add, commit: first repo. These four commands are 80% of daily Git.
Revision card 5 of 13: init, status, add, commit: first repo · Download PNG · Open card page

Lesson: 2.5 init, status, add, commit — first repo

The staging area mental model. Staging confuses everyone at first.
Revision card 6 of 13: The staging area mental model · Download PNG · Open card page

Lesson: 2.6 The staging area — mental model

Clone: copy an existing repo. On a team you start from an existing repo, not a new one.
Revision card 7 of 13: Clone: copy an existing repo · Download PNG · Open card page

Lesson: 2.7 clone — copy an existing repo

.gitignore: keep junk and secrets out. Committed secrets and junk are hard to remove and can leak.
Revision card 8 of 13: .gitignore: keep junk and secrets out · Download PNG · Open card page

Lesson: 2.8 .gitignore — keep junk and secrets out

git log: read the story. History is only useful if you can read it fast.
Revision card 9 of 13: git log: read the story · Download PNG · Open card page

Lesson: 2.9 git log — read the story

Undo safely: restore and amend. Panic undo commands can destroy work.
Revision card 10 of 13: Undo safely: restore and amend · Download PNG · Open card page

Lesson: 2.10 Undo safely — restore and amend

Commit message hygiene. Bad messages make history useless.
Revision card 11 of 13: Commit message hygiene · Download PNG · Open card page

Lesson: 2.11 Commit message hygiene

HTTPS vs SSH and git remote -v. Push fails if the login method isn't set up.
Revision card 12 of 13: HTTPS vs SSH and git remote -v · Download PNG · Open card page

Lesson: 2.12 HTTPS vs SSH, and git remote -v

Lab: three commits and one remote. Doing it end to end once removes the fear.
Revision card 13 of 13: Lab: three commits and one remote · Download PNG · Open card page

Lesson: 2.13 Lab — three commits and one remote

Interview cards

Why use Git instead of copying folders? Git keeps a history of every change with author and message, lets you go back, and lets many people merge work.
Interview card 1 of 13: Why use Git instead of copying folders? · Download PNG · Open card page

Lesson: 2.1 Why Git — zip folders vs history

Git vs GitHub? Git is the version control tool on your machine. GitHub is a hosting service for Git repos with pull requests and CI.
Interview card 2 of 13: Git vs GitHub? · Download PNG · Open card page

Lesson: 2.2 Git vs GitHub vs Git Bash

What is origin in Git? The default name for the remote you cloned from or first added, usually your GitHub repo.
Interview card 3 of 13: What is origin in Git? · Download PNG · Open card page

Lesson: 2.3 Repository, remote and origin

What do you set right after installing Git? Your user.name and user.email with git config, so commits show who made them.
Interview card 4 of 13: What do you set right after installing Git? · Download PNG · Open card page

Lesson: 2.4 Install check and first vocabulary

Walk me through creating a first commit. git init, create a file, git add it, then git commit -m with a clear message; check with git status.
Interview card 5 of 13: Walk me through creating a first commit. · Download PNG · Open card page

Lesson: 2.5 init, status, add, commit — first repo

Why does Git have a staging area? So you can choose exactly which changes go in a commit, keeping commits small and focused.
Interview card 6 of 13: Why does Git have a staging area? · Download PNG · Open card page

Lesson: 2.6 The staging area — mental model

clone vs download ZIP? Clone gives full history and a remote link to push/pull. A ZIP is just files with no history.
Interview card 7 of 13: clone vs download ZIP? · Download PNG · Open card page

Lesson: 2.7 clone — copy an existing repo

What goes in .gitignore? Build outputs, dependencies, logs, local settings and secret files like .env.
Interview card 8 of 13: What goes in .gitignore? · Download PNG · Open card page

Lesson: 2.8 .gitignore — keep junk and secrets out

How do you find when a line changed? git log -p file shows changes per commit; git blame file shows the last commit for each line.
Interview card 9 of 13: How do you find when a line changed? · Download PNG · Open card page

Lesson: 2.9 git log — read the story

How do you fix a typo in your last commit message? git commit --amend if it's not pushed yet. If pushed, leave it or add a new commit.
Interview card 10 of 13: How do you fix a typo in your last commit message? · Download PNG · Open card page

Lesson: 2.10 Undo safely — restore and amend

What makes a good commit message? A short imperative summary (under ~50 chars), then optional body with the why; link a ticket if used.
Interview card 11 of 13: What makes a good commit message? · Download PNG · Open card page

Lesson: 2.11 Commit message hygiene

HTTPS or SSH for Git remotes? Both work. SSH keys avoid typing tokens; HTTPS works through strict firewalls. Never share the private key.
Interview card 12 of 13: HTTPS or SSH for Git remotes? · Download PNG · Open card page

Lesson: 2.12 HTTPS vs SSH, and git remote -v

How do you put an existing local repo on GitHub? Create an empty GitHub repo, git remote add origin URL, then git push -u origin main.
Interview card 13 of 13: How do you put an existing local repo on GitHub? · Download PNG · Open card page

Lesson: 2.13 Lab — three commits and one remote

Comparison cards

Git vs GitHub. Git: a tool on your PC that saves project history as commits.GitHub: a website that hosts Git repos online.
Comparison card 1 of 3: Git vs GitHub · Download PNG · Open card page

Lesson: 2.2 Git vs GitHub vs Git Bash

HTTPS vs SSH (Git remotes). HTTPS: connect with a web URL and a token.SSH: connect with a key pair (private on PC, public on GitHub).
Comparison card 2 of 3: HTTPS vs SSH (Git remotes) · Download PNG · Open card page

Lesson: 2.12 HTTPS vs SSH, and git remote -v

git clone vs git init. git init: start a new empty repo in a folder.git clone: copy an existing repo with all history.
Comparison card 3 of 3: git clone vs git init · Download PNG · Open card page

Lesson: 2.7 clone — copy an existing repo