Skip to content

Files

Latest commit

 

History

History
467 lines (304 loc) · 9.76 KB

slides.md

File metadata and controls

467 lines (304 loc) · 9.76 KB
favicon fonts hideInToc highlighter info title theme author authorUrl backgroundUrl class backgroundSource backgroundSourceUrl date
sans serif mono local
Roboto
Roboto Slab
Fira Code
Fira Code, Roboto, Roboto Slab
true
prism
<h2>Git's Most Wanted</h2> <h5 class="font-light">Alexander Eble</h5> <a href="https://www.alexeble.de" target="_blank" rel="noreferrer"><img alt="Alexander Eble Logo" class="w-48px" src="https://alexeble.mo.cloudinary.net/logo.png"></a> The presentation is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA</a>. <ul> <li> <a href="https://www.alexeble.de/impressum/" target="_blank">Legal information of this website</a> </li> <li> <a href="https://www.alexeble.de/datenschutz/" target="_blank">Privacy policy of this website</a> </li> </ul>
Alexander Eble • Git's Most Wanted
academic
Alexander Eble
text-white
unsplash
03/11/2022

Git's Most Wanted

Git Commands Needed in the Everyday Workflow


hideInToc: true

Target Group

Developers who..

  • just started with Git and need a curated source of what is really important.
  • are already familiar with Git but need a refresher.
  • are already familiar with Git GUIs but intend to switch to the CLI.

class: "text-center" layout: center hideInToc: true preload: false

Prerequisites

Linus Tovalds ..and Linus Tovald's blessing1
BBC International

hideInToc: true layout: table-of-contents class: text-xs


git init

Create an empty Git repository or reinitialize an existing one1

git init
Git. git-init

git clone

Clone a repository into a new directory1

git clone
Git. git-clone

git status

Show the working tree status1

git status

git status --ignored
Git. git-status

git add

Add file contents to the index1

git add [<pathspec>...]

git add -A

git add -i [<pathspec>...]

git add -p [<pathspec>...]
Git. git-add

git diff

Show changes between commits, commit and working tree, etc1

git diff [<pathspec>...]

git diff --staged [<pathspec>...]

git diff [<remote>]/<branch>
Git. git-diff

git restore

Restore working tree files1

git restore [<pathspec>...]

git restore --staged [<pathspec>...]
Git. git-restore

git commit

Record changes to the repository1

git commit [<pathspec>...]

git commit -a [<pathspec>...]

git commit -m <msg> [<pathspec>...]

git commit --amend -m <newmsg> [<pathspec>...]

git commit --no-edit [<pathspec>...]
Git. git-commit

git config

Get and set repository or global options1

git config <name> <value>

git config --global <name> <value>

git config --list
Git. git-config

git log

Show commit logs1

git log

git log --oneline

git log -x
Git. git-log

git show

Show various types of objects1

git show [<object>…​]
Git. git-show

git reset

Reset current HEAD to the specified state1

git reset HEAD~x

git reset --hard <remote>/<branch>
Git. git-reset

git revert

Revert some existing commits1

git revert --no-edit <commit>
Git. git-revert

git remote

Manage set of tracked repositories1

git remote add <name> <URL>

git remote set-url <name> <newurl>

git remote -v
Git. git-remote

git push

Update remote refs along with associated objects1

git push

git push -u <remote> <branch>

git push -d <remote> <branch>
Git. git-push

git fetch

Download objects and refs from another repository1

git fetch

git fetch --all

git fetch --prune
Git. git-fetch

git pull

Fetch from and integrate with another repository or a local branch1

git pull

git config pull.rebase <true | false>

git config pull.ff <false | only>
Git. git-pull

git branch

List, create, or delete branches1

git branch

git branch <name>

git branch -v

git branch -a

git branch -D <name>
Git. git-branch

git checkout

Switch branches or restore working tree files1

git checkout <branch>

git checkout -b <branch>
Git. git-checkout

git merge / git rebase

Join two or more development histories together1

git merge <branch>

git merge --squash <branch>

Reapply commits on top of another base tip2

git rebase <branch>

git rebase --continue

git rebase --abort

git rebase -i <commit>

git rebase <commit> --onto <branch>
Git. git-merge Git. git-rebase

git stash

Stash the changes in a dirty working directory away1

git stash

git stash push <pathspec>

git stash show

git stash show -v

git stash pop

git stash drop
Git. git-stash

git clean

Remove untracked files from the working tree1

git clean -f

git clean -d
Git. git-clean