favicon | fonts | hideInToc | highlighter | info | title | theme | author | authorUrl | backgroundUrl | class | backgroundSource | backgroundSourceUrl | date | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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 |
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.
BBC International
Create an empty Git repository or reinitialize an existing one1
git init
Clone a repository into a new directory1
git clone
Show the working tree status1
git status
git status --ignored
Add file contents to the index1
git add [<pathspec>...]
git add -A
git add -i [<pathspec>...]
git add -p [<pathspec>...]
Show changes between commits, commit and working tree, etc1
git diff [<pathspec>...]
git diff --staged [<pathspec>...]
git diff [<remote>]/<branch>
Restore working tree files1
git restore [<pathspec>...]
git restore --staged [<pathspec>...]
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>...]
Get and set repository or global options1
git config <name> <value>
git config --global <name> <value>
git config --list
Show commit logs1
git log
git log --oneline
git log -x
Show various types of objects1
git show [<object>…]
Reset current HEAD to the specified state1
git reset HEAD~x
git reset --hard <remote>/<branch>
Revert some existing commits1
git revert --no-edit <commit>
Manage set of tracked repositories1
git remote add <name> <URL>
git remote set-url <name> <newurl>
git remote -v
Update remote refs along with associated objects1
git push
git push -u <remote> <branch>
git push -d <remote> <branch>
Download objects and refs from another repository1
git fetch
git fetch --all
git fetch --prune
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>
List, create, or delete branches1
git branch
git branch <name>
git branch -v
git branch -a
git branch -D <name>
Switch branches or restore working tree files1
git checkout <branch>
git checkout -b <branch>
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>
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
Remove untracked files from the working tree1
git clean -f
git clean -d