From b614238024866048eb89446c1e0c684fc4129fe7 Mon Sep 17 00:00:00 2001 From: scbj Date: Fri, 6 Dec 2024 14:23:31 +0100 Subject: [PATCH] documented keypoints of 'senekors' git lesson --- git.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/git.md b/git.md index 42136ea..23a35a7 100644 --- a/git.md +++ b/git.md @@ -2,9 +2,22 @@ ## Table of contents +- [glossary](#glossary) - [branches](#branches) - [create a branch](#create-a-branch) - [submodules](#submodules) +- [philosophies](#philosophies) + - [merge](#merge) + - [rebase](#rebase) + +## terminology + +| term | description | +| :--- | :---------- | +| `^` | one commit back (in history), use `^` | +| head | pointer to branch (usually latest commit, unless detached=pointer to specific commit) currently checked out locally | +| index | keeps track of `staged/cached` (with git add) changes | +| working tree | local file working directory | ## branches @@ -36,3 +49,34 @@ git clone --recurse-submodules # if repo is already cloned git submodule update --init --recursive ``` + + +## philosophies + +Important things to always remember: +**- do renaming in seperate commit** +**- don't merge conflicts with directories** + + +### merge + +When following the philosophie of merging, one merges the target branch into ones working, solves all conflicts, tests the result and then merges the working branch into the target branch. This is done with +```sh +# merges 'target-branch' into curret branch +git merge + +# proceeds after solving merge conflict +git merge --continue +``` + + +### rebase + +When following the philosophie of rebasing, one rebases the feature branch onto the target branch. This is done with +```sh +# rebases current branch onto 'target-branch' +git rebase + +# proceeds after solving rebase conflict +git rebase --continue +```