Skip to content

Latest commit

 

History

History
293 lines (197 loc) · 3.78 KB

deck.mdx

File metadata and controls

293 lines (197 loc) · 3.78 KB

import micorixTheme from './theme'; import {DeckHeading, FullFrame, GitAreaFlex, Layout, NarrowContainer, RoundedImage} from "./styles"; export const theme = micorixTheme;

Git Intro


Before we begin

Installing git

You can download it from here

Verifying installation

git --version

What's this talk about?

Version control system

  • Keeping track of software version
  • Possibility to revert unwanted changes
  • (Easy) Collaboration

Linus Torvalds

Creator of git & linux kernel maintainer

You can disagree with me as much as you want, but during this talk, by definition anybody who disagrees is stupid and ugly. So keep that in mind. When I'm done speaking, you can go on with their lives.

WTH is git?

Git is distributed, file-based version control system


See what's under the hood


Unified experience


Let's dive in!


Initializing the repo

git init

Look into the .git dir


Snapshots not diffs


Basic objects

  • blob
  • tree
  • commit

Branches

Branch as a pointer


Working directory Staging area Repository

Checking what we have

Checking whether we have unstaged files

git status

Browsing previous commits

git log

Adding files to the staging area

git add some_file.py another_file.java

You can use dot to add all modified files (regex)

git add .

Moving, renaming, deleting files

git mv some_file.py
git rm some_file.py

How it works under the hood?

rm some_file.py
git add some_file.py

Commit & push

git commit -m "My commit message"
git push

When pushing for the first time

git push -u origin my_branch
  • where my_branch is usually master or main.

Other useful commands

git diff
git merge
git checkout
git pull

Additional resources

You can find them in git-intro-workshop repo


Thanks for your attention!