commit c4ead2998ffaed6668d02a7ee7cf189fe7670e94 Author: Stefan Pranger Date: Tue Sep 27 10:32:20 2022 +0200 First Versions of *vpm diff --git a/001.vpm b/001.vpm new file mode 100644 index 0000000..b32f6e5 --- /dev/null +++ b/001.vpm @@ -0,0 +1,12 @@ + + + + ┏━╸╻╺┳╸ ╻ ╻┏━┓┏━┓╻┏ ┏━┓╻ ╻┏━┓┏━┓ + ┃╺┓┃ ┃ ╺━╸ ┃╻┃┃ ┃┣┳┛┣┻┓┗━┓┣━┫┃ ┃┣━┛ + ┗━┛╹ ╹ ┗┻┛┗━┛╹┗╸╹ ╹┗━┛╹ ╹┗━┛╹ + + + + 27. September 2022 + Pranger Stefan + diff --git a/002.vpm b/002.vpm new file mode 100644 index 0000000..1c3b9f6 --- /dev/null +++ b/002.vpm @@ -0,0 +1,16 @@ + + + + ┏━┓┏━┓┏━┓╺┳┓┏┳┓┏━┓┏━┓ + ┣┳┛┃ ┃┣━┫ ┃┃┃┃┃┣━┫┣━┛ + ╹┗╸┗━┛╹ ╹╺┻┛╹ ╹╹ ╹╹ + + + + - git basics, what is git capable of + - what do to in what situations + - project management + - pull requests and feature branches + - bug tracking + - continuous integration + - git gadgets (grep, bisect, etc.) diff --git a/003.vpm b/003.vpm new file mode 100644 index 0000000..3750ed1 --- /dev/null +++ b/003.vpm @@ -0,0 +1,21 @@ + + + + ┏┳┓┏━┓╻┏┓╻ ┏━┓┏━┓╻┏┓╻╺┳╸┏━┓ + ┃┃┃┣━┫┃┃┗┫ ┣━┛┃ ┃┃┃┗┫ ┃ ┗━┓ + ╹ ╹╹ ╹╹╹ ╹ ╹ ┗━┛╹╹ ╹ ╹ ┗━┛ + + + + - Staging Area and + - Interactive Rebasing for well crafted commits, + + - Merging and Rebasing, + + - Pull Request workflow and + + - Git as inspection tool. + + + + diff --git a/004.vpm b/004.vpm new file mode 100644 index 0000000..a6e5afc --- /dev/null +++ b/004.vpm @@ -0,0 +1,28 @@ + + + + ┏━╸╻╺┳╸ ┏┓ ┏━┓┏━┓╻┏━╸┏━┓ + ┃╺┓┃ ┃ ┣┻┓┣━┫┗━┓┃┃ ┗━┓ + ┗━┛╹ ╹ ┗━┛╹ ╹┗━┛╹┗━╸┗━┛ + + + + - _distributed_ version control + - staging area + - git add, git reset, etc. instead of only commiting + - branching + - "killer feature" + - content-addressable filesystem + + + + + + + + + + + + + diff --git a/005.vpm b/005.vpm new file mode 100644 index 0000000..6bc0f3a --- /dev/null +++ b/005.vpm @@ -0,0 +1,17 @@ + + + + ┏━╸╻╺┳╸ ╻┏┓╻╻╺┳╸ + ┃╺┓┃ ┃ ┃┃┗┫┃ ┃ + ┗━┛╹ ╹ ╹╹ ╹╹ ╹ + + + + Create or clone a repository via + - $ git init + - $ git clone + + Basic configuration: + - $ git config --global user.name "Foo Bar" + - $ git config --global user.email foobar@example.com + diff --git a/006.vpm b/006.vpm new file mode 100644 index 0000000..4cb8722 --- /dev/null +++ b/006.vpm @@ -0,0 +1,25 @@ + + + + ┏━┓╺┳╸┏━┓┏━╸╻┏┓╻┏━╸ ┏━┓┏━┓┏━╸┏━┓ + ┗━┓ ┃ ┣━┫┃╺┓┃┃┗┫┃╺┓ ┣━┫┣┳┛┣╸ ┣━┫ + ┗━┛ ╹ ╹ ╹┗━┛╹╹ ╹┗━┛ ╹ ╹╹┗╸┗━╸╹ ╹ + + + + - first main difference to SVN + - advantage of git + + Files can be: + + ┌─────────┐ ┌──────────┐ ┌────────┐ ┌──────┐ ┌────────┐ + │Untracked│ │Unmodified│ │Modified│ │Staged│ │Commited│ + └─────────┘ └──────────┘ └────────┘ └──────┘ └────────┘ + + Git manages these states as: + + ┌─────────────────┐ ┌─────┐ ┌────┐ + │Working Directory│ │Index│ │HEAD│ + └─────────────────┘ └─────┘ └────┘ + Your Sandbox The proposed The next + next commit parent diff --git a/007.vpm b/007.vpm new file mode 100644 index 0000000..6ca7161 --- /dev/null +++ b/007.vpm @@ -0,0 +1,17 @@ + + + + ┏━┓╺┳╸┏━┓┏━╸╻┏┓╻┏━╸ ┏━┓┏━┓┏━╸┏━┓ + ┗━┓ ┃ ┣━┫┃╺┓┃┃┗┫┃╺┓ ┣━┫┣┳┛┣╸ ┣━┫ + ┗━┛ ╹ ╹ ╹┗━┛╹╹ ╹┗━┛ ╹ ╹╹┗╸┗━╸╹ ╹ + + + + - git add + - git add --patch (-p) + - add individual lines (hunks) to commits + - "interactive staging" + - very useful to craft commits that are easy to understand + - git restore --staged/--worktree + - git reset --soft/--mixed/--hard + - git rm --cached diff --git a/008.vpm b/008.vpm new file mode 100644 index 0000000..767fe4c --- /dev/null +++ b/008.vpm @@ -0,0 +1,17 @@ + + + + ┏━┓╺┳╸┏━┓┏━╸╻┏┓╻┏━╸ ┏━┓┏━┓┏━╸┏━┓ + ┗━┓ ┃ ┣━┫┃╺┓┃┃┗┫┃╺┓ ┣━┫┣┳┛┣╸ ┣━┫ + ┗━┛ ╹ ╹ ╹┗━┛╹╹ ╹┗━┛ ╹ ╹╹┗╸┗━╸╹ ╹ + + + + Check your modifications or what you are about to commit + - git diff / git diff --staged + + Should help to have a clean process of commiting changes + Finalizing step: git commit + + What if I messed up my current commit? + - $ git commit --amend diff --git a/009.vpm b/009.vpm new file mode 100644 index 0000000..9678014 --- /dev/null +++ b/009.vpm @@ -0,0 +1,22 @@ + + + + ┏━╸╻╺┳╸ ┏━┓┏┓ ┏┓┏━╸┏━╸╺┳╸┏━┓ + ┃╺┓┃ ┃ ┃ ┃┣┻┓ ┃┣╸ ┃ ┃ ┗━┓ + ┗━┛╹ ╹ ┗━┛┗━┛┗━┛┗━╸┗━╸ ╹ ┗━┛ + + ┌────────────────┐ ┌──────────────────────┐main.c┌────┐ + │commit (b3aacfe)│───>│tree (think directory)│─────>│blob│ + └────────────────┘ └──────────────────────┘ └────┘ + | parent \ + v \ + ┌────────────────┐ ┌──────────────────────┐ \ + ┌──>│commit (a21fh1a)│───>│ tree │ \ + | └────────────────┘ └──────────────────────┘ \ + ┌───┐ / | \ \ + │tag│ main.c config.h main.h \ + └───┘ / | \ \ + ┌────┐ ┌────┐ ┌────┐<--° + │blob│ │blob│<-┐ │blob│ | + └────┘ └────┘ \ └────┘ | + └───────────┘ diff --git a/010.vpm b/010.vpm new file mode 100644 index 0000000..aa9b766 --- /dev/null +++ b/010.vpm @@ -0,0 +1,25 @@ + + + + ┏━┓┏━╸╻ ╻╻┏━┓╻┏━┓┏┓╻ ┏━┓┏━╸╻ ┏━╸┏━╸╺┳╸╻┏━┓┏┓╻ + ┣┳┛┣╸ ┃┏┛┃┗━┓┃┃ ┃┃┗┫ ┗━┓┣╸ ┃ ┣╸ ┃ ┃ ┃┃ ┃┃┗┫ + ╹┗╸┗━╸┗┛ ╹┗━┛╹┗━┛╹ ╹ ┗━┛┗━╸┗━╸┗━╸┗━╸ ╹ ╹┗━┛╹ ╹ + + ┌────────────────┐ + │commit (b3aacfe)│ + └────────────────┘ + + - $ git show -- + + - commits are referencable via + - their SHA1 + - HEAD + - tags/branchnames + + - Syntax: + - HEAD~ // select the n-th ancestor of HEAD + - .. + + - HEAD-history: + - HEAD@{} + diff --git a/011.vpm b/011.vpm new file mode 100644 index 0000000..8e632a4 --- /dev/null +++ b/011.vpm @@ -0,0 +1,19 @@ + + + + ┏┓ ┏━┓┏━┓┏┓╻┏━╸╻ ╻╻┏┓╻┏━╸ + ┣┻┓┣┳┛┣━┫┃┗┫┃ ┣━┫┃┃┗┫┃╺┓ + ┗━┛╹┗╸╹ ╹╹ ╹┗━╸╹ ╹╹╹ ╹┗━┛ + + + + - git's "killer feature" + + - A new branch is essentially just opening a new history + (i.e. no copying involved!) + + - Highly encouraged to use many (shortlived) branches + + Create a new branch with + - $ git switch --create/-c + diff --git a/013.vpm b/013.vpm new file mode 100644 index 0000000..8c007fb --- /dev/null +++ b/013.vpm @@ -0,0 +1,20 @@ + + + + ┏┓ ┏━┓┏━┓┏┓╻┏━╸╻ ╻╻┏┓╻┏━╸ + ┣┻┓┣┳┛┣━┫┃┗┫┃ ┣━┫┃┃┗┫┃╺┓ + ┗━┛╹┗╸╹ ╹╹ ╹┗━╸╹ ╹╹╹ ╹┗━┛ + + + + Switching between branches with + - $ git switch + - $ git switch - + + Cannot switch if that would overwrite modifications + + Untracked files will simply "move along" + + Delete or rename a branch: + - $ git branch -d + - $ git branch -m diff --git a/014.vpm b/014.vpm new file mode 100644 index 0000000..e9c873b --- /dev/null +++ b/014.vpm @@ -0,0 +1,16 @@ + + + + ┏━╸╻╺┳╸ ┏━┓╺┳╸┏━┓┏━┓╻ ╻ + ┃╺┓┃ ┃ ┗━┓ ┃ ┣━┫┗━┓┣━┫ + ┗━┛╹ ╹ ┗━┛ ╹ ╹ ╹┗━┛╹ ╹ + + + + Very helpful to quickly safe modifications + + - $ git stash push --message/-m "..." + - $ git stash list + - $ git stash apply/pop + + diff --git a/015.vpm b/015.vpm new file mode 100644 index 0000000..57fb80d --- /dev/null +++ b/015.vpm @@ -0,0 +1,15 @@ + + + + ┏━╸╻╺┳╸ ┏━┓╺┳╸┏━┓┏━┓╻ ╻ + ┃╺┓┃ ┃ ┗━┓ ┃ ┣━┫┗━┓┣━┫ + ┗━┛╹ ╹ ┗━┛ ╹ ╹ ╹┗━┛╹ ╹ + + + + $ git stash push -m "WIP some frontend feature" + $ git switch stable + ... + $ git commit + $ git switch frontend_feature + $ git stash pop diff --git a/016.vpm b/016.vpm new file mode 100644 index 0000000..aeef8f4 --- /dev/null +++ b/016.vpm @@ -0,0 +1,20 @@ + + + + ╻┏┓╻╺┳╸┏━╸┏━┓┏━┓┏━╸╺┳╸╻╻ ╻┏━╸ ┏━┓┏━╸┏┓ ┏━┓┏━┓╻┏┓╻┏━╸ + ┃┃┗┫ ┃ ┣╸ ┣┳┛┣━┫┃ ┃ ┃┃┏┛┣╸ ┣┳┛┣╸ ┣┻┓┣━┫┗━┓┃┃┗┫┃╺┓ + ╹╹ ╹ ╹ ┗━╸╹┗╸╹ ╹┗━╸ ╹ ╹┗┛ ┗━╸ ╹┗╸┗━╸┗━┛╹ ╹┗━┛╹╹ ╹┗━┛ + + + + - $ git rebase -i + + Can be used to cleanup commit history + + - allows to basically change the history of your commits + - each project should have a guideline + - small feature may for example be _squashed_ together + - WIP- or unnecessary commits can be removed + - remove _checkpoint commits_ + -> $ git rebase -i my_current_feature@{24.hours.ago}~1 + diff --git a/017.vpm b/017.vpm new file mode 100644 index 0000000..1bb0003 --- /dev/null +++ b/017.vpm @@ -0,0 +1,21 @@ + + + + ╻┏┓╻╺┳╸┏━╸┏━┓┏━┓┏━╸╺┳╸╻╻ ╻┏━╸ ┏━┓┏━╸┏┓ ┏━┓┏━┓╻┏┓╻┏━╸ + ┃┃┗┫ ┃ ┣╸ ┣┳┛┣━┫┃ ┃ ┃┃┏┛┣╸ ┣┳┛┣╸ ┣┻┓┣━┫┗━┓┃┃┗┫┃╺┓ + ╹╹ ╹ ╹ ┗━╸╹┗╸╹ ╹┗━╸ ╹ ╹┗┛ ┗━╸ ╹┗╸┗━╸┗━┛╹ ╹┗━┛╹╹ ╹┗━┛ + + + + # Commands: + # p, pick = use commit + # r, reword = use commit, but edit the commit message + # e, edit = use commit, but stop for amending + # s, squash = use commit, but meld into previous commit + # f, fixup = like "squash", but discard this commit's log message + ... + # + # These lines can be re-ordered; they are executed from top to bottom. + # + # If you remove a line here THAT COMMIT WILL BE LOST. + diff --git a/020.vpm b/020.vpm new file mode 100644 index 0000000..6b4edb1 --- /dev/null +++ b/020.vpm @@ -0,0 +1,17 @@ + + + + ┏━┓┏━╸┏┳┓┏━┓╺┳╸┏━╸┏━┓ + ┣┳┛┣╸ ┃┃┃┃ ┃ ┃ ┣╸ ┗━┓ + ╹┗╸┗━╸╹ ╹┗━┛ ╹ ┗━╸┗━┛ + + + + Remote server to share code base + + - Gets setup with $ git clone + - $ git remote add + + - $ git fetch + - $ git pull + - $ git push diff --git a/023.vpm b/023.vpm new file mode 100644 index 0000000..af8cb5e --- /dev/null +++ b/023.vpm @@ -0,0 +1,19 @@ + + + + ┏┳┓┏━╸┏━┓┏━╸╻┏┓╻┏━╸ + ┃┃┃┣╸ ┣┳┛┃╺┓┃┃┗┫┃╺┓ + ╹ ╹┗━╸╹┗╸┗━┛╹╹ ╹┗━┛ + + + + Multiple parallel workflows are encouraged + -> unavoidable conflicts + + - Project guideline on how to handle conflicts + + - For more advanced usage: + - $ git rerere + - different merging strategies + + diff --git a/024.vpm b/024.vpm new file mode 100644 index 0000000..274b258 --- /dev/null +++ b/024.vpm @@ -0,0 +1,22 @@ + + + + ┏┳┓┏━╸┏━┓┏━╸╻┏┓╻┏━╸ ┏━╸┏━╸ + ┃┃┃┣╸ ┣┳┛┃╺┓┃┃┗┫┃╺┓ ╺━╸ ┣╸ ┣╸ + ╹ ╹┗━╸╹┗╸┗━┛╹╹ ╹┗━┛ ╹ ╹ + + + + - _fast-forward_ merge possible if HEAD direct ancestor + - This allows for a clean, linear history on stable branches + - helps with git blame, git bisect, git rebase -i + + ┌─────────────────────────────────────────────────────────────┐ + │[spranger@gitWorkshop/stagingArea] git merge more_int_changes│ + │Updating eff74ed..a2c365a │ + │Fast-forward │ + │ testfile1 | 4 ++-- │ + │ 1 file changed, 2 insertions(+), 2 deletions(-) │ + └─────────────────────────────────────────────────────────────┘ + + - --ff, --no-ff, --ff-only diff --git a/025.vpm b/025.vpm new file mode 100644 index 0000000..f1426ec --- /dev/null +++ b/025.vpm @@ -0,0 +1,20 @@ + + + + ┏━┓┏━╸┏┓ ┏━┓┏━┓╻┏┓╻┏━╸ + ┣┳┛┣╸ ┣┻┓┣━┫┗━┓┃┃┗┫┃╺┓ + ╹┗╸┗━╸┗━┛╹ ╹┗━┛╹╹ ╹┗━┛ + + + + Allows to move bases of branches (and more) + + - Most common usage: Update the base of your branch if outdated + - Common strategy to _always_ ensure fast-forward merges + - Very helpful in complicated branching settings + + Important Note: + ┌─────────────────────────────────────────────────────────┐ + │Do not rebase commits that exist outside your repository │ + │ and that people (may) have based work on. │ + └─────────────────────────────────────────────────────────┘ diff --git a/026.vpm b/026.vpm new file mode 100644 index 0000000..dffac4a --- /dev/null +++ b/026.vpm @@ -0,0 +1,18 @@ + + + + ┏━╸┏━┓┏┓╻┏━╸╻ ╻┏━╸╺┳╸┏━┓ + ┃ ┃ ┃┃┗┫┣╸ ┃ ┃┃ ┃ ┗━┓ + ┗━╸┗━┛╹ ╹╹ ┗━╸╹┗━╸ ╹ ┗━┛ + + + + Git tracks (per hunk-) conflicts over three files: + - base/common + - ours + - theirs + + - $ git config --global merge.conflictstyle diff3 + - Often helpful to have common state + + diff --git a/027.vpm b/027.vpm new file mode 100644 index 0000000..4f155e5 --- /dev/null +++ b/027.vpm @@ -0,0 +1,22 @@ + + + + ┏━╸┏━┓┏┓╻┏━╸╻ ╻┏━╸╺┳╸┏━┓ + ┃ ┃ ┃┃┗┫┣╸ ┃ ┃┃ ┃ ┗━┓ + ┗━╸┗━┛╹ ╹╹ ┗━╸╹┗━╸ ╹ ┗━┛ + + ┌────────────────────────┐ ┌────────────────────────┐ + │ #include │ │ int main() { │ + │ <<<<<<< HEAD │ │ int a = 5; │ + │ #include │ │ <<<<<<< HEAD │ + │ ||||||| 9275968 │ │ int b = 4; │ + │ ======= │ │ ||||||| 9275968 │ + │ #include │ │ int b = 8; │ + │>>>>>>> new_feature │ │ ======= │ + └────────────────────────┘ │ int b = 9; │ + │ >>>>>>> new_feature │ + └────────────────────────┘ + - Conflict markers appear in the file itself + - Simplest way to handle: + -> directly modify the file + - Git difftool for visual conflict resolving diff --git a/030.vpm b/030.vpm new file mode 100644 index 0000000..76d1eb1 --- /dev/null +++ b/030.vpm @@ -0,0 +1,18 @@ + + + + ╺┳╸┏━╸┏━┓┏┳┓ ╻ ╻┏━┓┏━┓╻┏ ┏━╸╻ ┏━┓╻ ╻┏━┓ + ┃ ┣╸ ┣━┫┃┃┃ ┃╻┃┃ ┃┣┳┛┣┻┓┣╸ ┃ ┃ ┃┃╻┃┗━┓ + ╹ ┗━╸╹ ╹╹ ╹ ┗┻┛┗━┛╹┗╸╹ ╹╹ ┗━╸┗━┛┗┻┛┗━┛ + + + + Team Workflows: + - Merge vs. Rebase + - Only fast-forward? + - Keep merge commits? + + Branching Strategies: + - Main - Development - Feature branches - Stable branches + - Main - Feature branches + - etc. diff --git a/040.vpm b/040.vpm new file mode 100644 index 0000000..46f8a91 --- /dev/null +++ b/040.vpm @@ -0,0 +1,22 @@ + + + + ┏━╸┏━┓╻ ╻ ┏━┓┏┓ ┏━┓┏━┓┏━┓╺┳╸╻┏━┓┏┓╻ + ┃ ┃ ┃┃ ┃ ┣━┫┣┻┓┃ ┃┣┳┛┣━┫ ┃ ┃┃ ┃┃┗┫ + ┗━╸┗━┛┗━╸┗━╸╹ ╹┗━┛┗━┛╹┗╸╹ ╹ ╹ ╹┗━┛╹ ╹ + + + + Git usage in the bigger picture. + + - Issue tracking, + - Pull Request handling, + - Assigning work, + - Milestones, Projects, etc. + + Example frontends: + - GitHub + - Gitlab + - Gitea + - Gogs + diff --git a/041.vpm b/041.vpm new file mode 100644 index 0000000..e350feb --- /dev/null +++ b/041.vpm @@ -0,0 +1,18 @@ + + + + ╻┏━┓┏━┓╻ ╻┏━╸ ╺┳╸┏━┓┏━┓┏━╸╻┏ ┏━╸┏━┓ + ┃┗━┓┗━┓┃ ┃┣╸ ┃ ┣┳┛┣━┫┃ ┣┻┓┣╸ ┣┳┛ + ╹┗━┛┗━┛┗━┛┗━╸ ╹ ╹┗╸╹ ╹┗━╸╹ ╹┗━╸╹┗╸ + + + + - Note-tacking, + - feature requests, + - track bug reports from clients. + + - Use labels to categorize + - bug, good-first-issue, enhancement, etc. + - Associate milestones and assignees + + An issue should eventually be turned into a pull request (PR). diff --git a/042.vpm b/042.vpm new file mode 100644 index 0000000..0216644 --- /dev/null +++ b/042.vpm @@ -0,0 +1,20 @@ + + + + ┏━┓╻ ╻╻ ╻ ┏━┓┏━╸┏━┓╻ ╻┏━╸┏━┓╺┳╸┏━┓ + ┣━┛┃ ┃┃ ┃ ┣┳┛┣╸ ┃┓┃┃ ┃┣╸ ┗━┓ ┃ ┗━┓ + ╹ ┗━┛┗━╸┗━╸ ╹┗╸┗━╸┗┻┛┗━┛┗━╸┗━┛ ╹ ┗━┛ + + + + At the heart of your team's workflow + + - Accompanies a branch + - Gives the team + - a plattform to discuss progress, + - the branches history and + - a list of all introduces changes. + + Project lead can review and ask for changes one a line-by-line basis + + Basis for Continuous Integration diff --git a/043.vpm b/043.vpm new file mode 100644 index 0000000..5a49955 --- /dev/null +++ b/043.vpm @@ -0,0 +1,22 @@ + + + + ┏━╸┏━┓┏┓╻╻ ╻┏━╸┏┓╻╺┳╸╻┏━┓┏┓╻┏━┓╻ ┏━╸┏━┓┏┳┓┏┳┓╻╺┳╸┏━┓ + ┃ ┃ ┃┃┗┫┃┏┛┣╸ ┃┗┫ ┃ ┃┃ ┃┃┗┫┣━┫┃ ┃ ┃ ┃┃┃┃┃┃┃┃ ┃ ┗━┓ + ┗━╸┗━┛╹ ╹┗┛ ┗━╸╹ ╹ ╹ ╹┗━┛╹ ╹╹ ╹┗━╸ ┗━╸┗━┛╹ ╹╹ ╹╹ ╹ ┗━┛ + + + + Syntax: + ┌─────────────────────────────────────┐ + │[optional scope]: │ + │ │ + │[optional body] │ + │ │ + │[optional footer(s)] │ + └─────────────────────────────────────┘ + + - They enable + - automated CHANGELOGs and, + - automated semantic version bump and + - greatly help with readability. diff --git a/044.vpm b/044.vpm new file mode 100644 index 0000000..9f45046 --- /dev/null +++ b/044.vpm @@ -0,0 +1,15 @@ + + + + ┏━╸┏━┓┏┓╻╻ ╻┏━╸┏┓╻╺┳╸╻┏━┓┏┓╻┏━┓╻ ┏━╸┏━┓┏┳┓┏┳┓╻╺┳╸┏━┓ + ┃ ┃ ┃┃┗┫┃┏┛┣╸ ┃┗┫ ┃ ┃┃ ┃┃┗┫┣━┫┃ ┃ ┃ ┃┃┃┃┃┃┃┃ ┃ ┗━┓ + ┗━╸┗━┛╹ ╹┗┛ ┗━╸╹ ╹ ╹ ╹┗━┛╹ ╹╹ ╹┗━╸ ┗━╸┗━┛╹ ╹╹ ╹╹ ╹ ┗━┛ + + + + ┌──────────────────────────────────────────────────────────┐ + │feat: allow provided config object to extend other configs│ + │ │ + │BREAKING CHANGE: `extends` key in config file is now │ + │used for extending other config files │ + └──────────────────────────────────────────────────────────┘ diff --git a/046.vpm b/046.vpm new file mode 100644 index 0000000..bfdbf47 --- /dev/null +++ b/046.vpm @@ -0,0 +1,12 @@ + + + + ┏┳┓╻┏━┓┏━╸┏━╸╻ ╻ ┏━┓┏┓╻┏━╸┏━┓╻ ╻┏━┓ + ┃┃┃┃┗━┓┃ ┣╸ ┃ ┃ ┣━┫┃┗┫┣╸ ┃ ┃┃ ┃┗━┓ + ╹ ╹╹┗━┛┗━╸┗━╸┗━╸┗━╸╹ ╹╹ ╹┗━╸┗━┛┗━┛┗━┛ + + + + - Protect master branch + - Repository setting for PRs help with team workflow + - e.g. can be set to create merge commits. diff --git a/050.vpm b/050.vpm new file mode 100644 index 0000000..7789dfa --- /dev/null +++ b/050.vpm @@ -0,0 +1,17 @@ + + + + ┏━┓┏┓╻┏━┓╻ ╻ ╻┏━┓╻┏━┓ ╻┏┓╻┏━┓┏━┓┏━╸┏━╸╺┳╸╻┏━┓┏┓╻ + ┣━┫┃┗┫┣━┫┃ ┗┳┛┗━┓┃┗━┓ ╺━╸ ┃┃┗┫┗━┓┣━┛┣╸ ┃ ┃ ┃┃ ┃┃┗┫ + ╹ ╹╹ ╹╹ ╹┗━╸ ╹ ┗━┛╹┗━┛ ╹╹ ╹┗━┛╹ ┗━╸┗━╸ ╹ ╹┗━┛╹ ╹ + + + + - Search through: code, modifications, commits or commit messages. + - Look at history of lines of code + - Binary search for bugs + - List of most recent changes + + + + diff --git a/051.vpm b/051.vpm new file mode 100644 index 0000000..1a2c193 --- /dev/null +++ b/051.vpm @@ -0,0 +1,19 @@ + + + + ┏━╸╻╺┳╸ ╻ ┏━┓┏━╸ + ┃╺┓┃ ┃ ┃ ┃ ┃┃╺┓ + ┗━┛╹ ╹ ┗━╸┗━┛┗━┛ + + + + - $ git log + - --patch, --after, --since, --before, --committer + - -S"" // code + - -L ,: // history of lines of code + - -L :: // history of a function + - --grep "" // commit messages + + - $ git log --oneline + - $ git log --graph + diff --git a/052.vpm b/052.vpm new file mode 100644 index 0000000..9335bec --- /dev/null +++ b/052.vpm @@ -0,0 +1,30 @@ + + + + ┏━╸╻╺┳╸ ┏┓ ╻ ┏━┓┏┳┓┏━╸ + ┃╺┓┃ ┃ ┣┻┓┃ ┣━┫┃┃┃┣╸ + ┗━┛╹ ╹ ┗━┛┗━╸╹ ╹╹ ╹┗━╸ + + + + - $ git blame + ┌────────────────────────────────────────────────────────────────┐ + │[spranger@gitWorkshop/stagingArea] git blame testfile1 │ + │2 days ago Stefan ^3b4a655│ 1 │ #include │ + │ │ 2 │ #include │ + │a day ago Stefan 08b88afb│ 3 │ #include │ + │2 days ago Stefan ^3b4a655│ 4 │ │ + │ │ 5 │ int main() { │ + │3 hours ago Stefan a2c365ad│ 6 │ int a = 1; │ + │ │ 7 │ int b = 2; │ + │2 days ago Stefan ^3b4a655│ 8 │ │ + │2 days ago Stefan a0bd6d8c│ 9 │ │ + │ │ 10 │ return a+b; │ + │2 days ago Stefan ^3b4a655│ 11 │ } │ + └────────────────────────────────────────────────────────────────┘ + + + + + + diff --git a/053.vpm b/053.vpm new file mode 100644 index 0000000..4903d24 --- /dev/null +++ b/053.vpm @@ -0,0 +1,15 @@ + + + + ┏━╸╻╺┳╸ ┏━╸┏━┓┏━╸┏━┓ + ┃╺┓┃ ┃ ┃╺┓┣┳┛┣╸ ┣━┛ + ┗━┛╹ ╹ ┗━┛╹┗╸┗━╸╹ + + + + Powerful tool to search for code snippets + + - $ git grep "" + - -A , -B , -C + - --show-function/-p + - --function-context/-W diff --git a/054.vpm b/054.vpm new file mode 100644 index 0000000..a7678d9 --- /dev/null +++ b/054.vpm @@ -0,0 +1,22 @@ + + + + ┏━╸╻╺┳╸ ┏┓ ╻┏━┓┏━╸┏━╸╺┳╸ + ┃╺┓┃ ┃ ┣┻┓┃┗━┓┣╸ ┃ ┃ + ┗━┛╹ ╹ ┗━┛╹┗━┛┗━╸┗━╸ ╹ + + + + Binary search to find commit that introduced a bug. + + ┌──────────────────────────────────────────┐ + │$ git bisect start │ + │$ git bisect bad │ + │$ git bisect good │ + └──────────────────────────────────────────┘ + + ┌──────────────────────────────────────────┐ + │$ git bisect start HEAD HEAD~10 -- │ + │$ git bisect run make test │ + │$ git bisect reset │ + └──────────────────────────────────────────┘ diff --git a/070.vpm b/070.vpm new file mode 100644 index 0000000..b7dc257 --- /dev/null +++ b/070.vpm @@ -0,0 +1,12 @@ + + + + ┏━┓┏━┓╺┳╸┏━╸╻ ╻╻┏┓╻┏━╸ + ┣━┛┣━┫ ┃ ┃ ┣━┫┃┃┗┫┃╺┓ + ╹ ╹ ╹ ╹ ┗━╸╹ ╹╹╹ ╹┗━┛ + + + + - Revert already commited changes + - Pick a range of commits from different branches + - Turn a commit into a git-readable file diff --git a/071.vpm b/071.vpm new file mode 100644 index 0000000..b270041 --- /dev/null +++ b/071.vpm @@ -0,0 +1,14 @@ + + + + ┏━╸╻╺┳╸ ┏━┓┏━╸╻ ╻┏━╸┏━┓╺┳╸ + ┃╺┓┃ ┃ ┣┳┛┣╸ ┃┏┛┣╸ ┣┳┛ ┃ + ┗━┛╹ ╹ ╹┗╸┗━╸┗┛ ┗━╸╹┗╸ ╹ + + + + Revert commits via new commits + + - Should be used when the commits are already public + + - $ git revert .. diff --git a/072.vpm b/072.vpm new file mode 100644 index 0000000..609b561 --- /dev/null +++ b/072.vpm @@ -0,0 +1,20 @@ + + + + ┏━╸╻╺┳╸ ┏━╸╻ ╻┏━╸┏━┓┏━┓╻ ╻ ┏━┓╻┏━╸╻┏ + ┃╺┓┃ ┃ ┃ ┣━┫┣╸ ┣┳┛┣┳┛┗┳┛╺━╸┣━┛┃┃ ┣┻┓ + ┗━┛╹ ╹ ┗━╸╹ ╹┗━╸╹┗╸╹┗╸ ╹ ╹ ╹┗━╸╹ ╹ + + + + Specify commits and apply them onto your HEAD + + - $ git cherry-pick .. + + - $ git cherry-pick ..master + - essentially the same as $ git rebase master + + - Useful if e.g. a hotfix has been pushed to a stable branch + - Might need to clean such commits before merging + + diff --git a/073.vpm b/073.vpm new file mode 100644 index 0000000..2459e0c --- /dev/null +++ b/073.vpm @@ -0,0 +1,15 @@ + + + + ┏━╸┏━┓┏━┓┏┳┓┏━┓╺┳╸ ┏━┓┏━┓╺┳╸┏━╸╻ ╻ ┏┓ ┏━┓┏━┓┏━┓╻ ╻ ╻ + ┣╸ ┃ ┃┣┳┛┃┃┃┣━┫ ┃ ╺━╸┣━┛┣━┫ ┃ ┃ ┣━┫ ┃╺╋╸ ┣━┫┣━┛┣━┛┃ ┗┳┛ + ╹ ┗━┛╹┗╸╹ ╹╹ ╹ ╹ ╹ ╹ ╹ ╹ ┗━╸╹ ╹ ┗━┛ ╹ ╹╹ ╹ ┗━╸ ╹ + + + + In certain situations it might be sensible to send commits per mail + + - $ git format-patch -1 + - colleague does not need to checkout your branch + + - $ git apply diff --git a/090.vpm b/090.vpm new file mode 100644 index 0000000..9a2b94d --- /dev/null +++ b/090.vpm @@ -0,0 +1,22 @@ + + + + ┏┳┓┏━┓┏━┓┏━╸ ┏━┓┏┓╻╺┳┓ ┏┳┓┏━┓┏━┓┏━╸ + ┃┃┃┃ ┃┣┳┛┣╸ ┣━┫┃┗┫ ┃┃ ┃┃┃┃ ┃┣┳┛┣╸ + ╹ ╹┗━┛╹┗╸┗━╸ ╹ ╹╹ ╹╺┻┛ ╹ ╹┗━┛╹┗╸┗━╸ + + + + - git notes, + - commit signing, + - merge strategies, + - git worktree, + - refs, + - git reflog, + - porcelain commands and scripting, + - the power of .gitconfig, + - hooks on the server, + - multiple remotes, + - etc. + +