Browse Source

Morning workshops

master
Skia 3 years ago
parent
commit
d518db41aa
  1. 62
      workshops/1 - Visualizing Git/notes.md
  2. 34
      workshops/2 - Git hooks, aliases, and bears oh my/notes.md

62
workshops/1 - Visualizing Git/notes.md

@ -0,0 +1,62 @@
# Visualizing git
Very awesome learning tool
https://git-school.github.io/visualizing-git/
## Basics
Refs are pointers
Can point to others refs or commits
## reflog
tracks HEAD's activity
commits on no branch are "dangling"
example:
```
git checkout HEAD~2
git commit
git commit
git checkout -b new_branch
```
## merging, rebasing
`git merge feature_branch --no-ff`
forces a merge commit: easier to revert a new feature
reflog tracks all the steps of a rebase
`git reflog my_branch`
-> history of this branch
## working with remotes
`git pull` ~= `git fetch && git merge`
`git pull --rebase` ~= `git fetch && git rebase`
## amends, force pushs
`git reset --hard head@{1}` -> undo an amend
## cherry-pick and revert
`git cherry-pick <idofmergecommit>` -> not possible, need to precise on which
mainline to compare the changes
`git cherry-pick <idofmergecommit> -m1` -> set mainline to first parent of merge commit
works the same for `revert`ing a merge commit
## Conclusion
`reflog` is you friend!
kuychaco@github.com"
## Personal feedback
Good live presentation on an awesome tool that can be **really** awesome to
explain git concepts easily to someone.

34
workshops/2 - Git hooks, aliases, and bears oh my/notes.md

@ -0,0 +1,34 @@
# Git hooks, aliases, and bears oh my
https://bitbucket.org/MikeCorsaro/git-scripts.git
Cool slides with most of the content:
https://bitbucket.org/MikeCorsaro/git-scripts/src/a9238748c6a891fdab447b5b58af8542a39a8ad7/GitMerge_AliasesHooksOhMy.pptx
## aliases
```
[alias]
st = "!git status"
```
alias-ception:
```
[alias]
lg = "...."
lgg = "!git lg --graph"
```
Put `git-standup` in your `$PATH`, then `git standup` works
## hooks
Very useful to check many different things: commit messages, run tests, check
for naughty words in your code source, etc...
Advanced hooks can be used to add emojis based on a webcam picture of your face.
## Personal feedback
Nice and fun presentation, pushing aliases and hooks to a higher level!
Loading…
Cancel
Save