git
Block 1.1: Reviewing git
Basics
Background: https://unsplash.com/photos/842ofHC6MaI
git
git
itself is a CLI program*: These programs have a different main purpose, but also offer the option of using git via their GUI.
git
commandsI hope some of these git commands sound familiar to you.
git status
git init
git add
git commit
git restore
git stash
git checkout
git branch
git switch
git merge
git pull / push
git cherry-pick
Changes can be either unstaged, staged or commited.
add
the change to the staging area it is stagedcommit
all staged changesChanges can be either unstaged, staged or commited.
restore
the commited version (and remove any unstaged changes)add
endum: git add -i
You can also interactively add changes with -i
.
git add -i
# staged unstaged path
# 1: unchanged +4/-0 1.1-git-basics.qmd
# *** Commands ***
# 1: status 2: update 3: revert 4: add untracked
# 5: patch 6: diff 7: quit 8: help
# What now>
There’s also an extension available.
git-example
cookbook.md
in your git-example
directorySince VSCode is primarily a text editor, git functionality is hidden in the sidebar
cookbook.md
and restore it.gitgnore
.gitignore
📰!
dir/**
and !dir/.gitkeep
dir/
vs. dir/**
dir/
and !dir/.gitkeep
?dir/
, the whole directory is ignored and git will not scan it at allAny Questions?