From 57d85eebcdc2c2d22811d197aeee47832be7311a Mon Sep 17 00:00:00 2001 From: Adrian Stoica <stoica@ntnu.no> Date: Mon, 25 Sep 2023 13:23:11 +0200 Subject: [PATCH] edit: update lecture 10 slides --- lectures/revealjs/10-git-branching.adoc | 102 ++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 lectures/revealjs/10-git-branching.adoc diff --git a/lectures/revealjs/10-git-branching.adoc b/lectures/revealjs/10-git-branching.adoc new file mode 100644 index 0000000..25a1dca --- /dev/null +++ b/lectures/revealjs/10-git-branching.adoc @@ -0,0 +1,102 @@ += Git Branching +:customcss: slides.css +:icons: font +:includedir: includes/ +:LECTURE_TOPIC: Git Branching +:LECTURE_NO: 10th Lecture + +include::{includedir}header.adoc[] + +[.smaller-80][.center-paragraph] +IT1901 Fall 2023 - {LECTURE_NO} + + +[background-color = "#124990"] +[color = "#fff6d5"] +== Git Branching + +== Git Branching + +- Using branches +- Managing conflicts +- Dealing with interruptions +- Summary + + +[.grid-left-right-50-50] +== Typical sequence (simple collaboration) + +[.area-left] +- working with a shared project +** `git clone` +** `git pull` + +[.area-right] +** `git status` +** `git add ...` +** `git commit ...` +** `git push` + + +== Possible improved workflow + +- keep master only for finished work +- uses branches for development work +- when a feature branch is done it is merged into master + +[.grid-left-right-50-50] +== Typical sequence (branches) + +[.area-left] +** `git clone` +** `git pull` +** `git checkout -b <branch_name>` + +[.area-right] +** `git status` + `git add ...` + `git commit ...` +** `git checkout master` +** `git merge <branch_name>` +** `git push` + +[background-color = "#124990"] +[color = "#fff6d5"] +== Git Branching + +== Conflicts (1) + +** when same files (lines) are changed by different devs +** automatic merge is not possible +** we need to solve that to be able to push our changes + +== Conflicts (2) - Setup VSCode + +- `git config merge.tool vimdiff` +- `git config merge.conflictstyle diff3` +- `git config mergetool.prompt false` + +== Conflicts (3) - Solving + +- `git mergetool` +- `:wqa` save and exit from vi +- `git commit -m "message"` +- `git clean` remove file (might remove other untracked files) + + + + +[background-color = "#124990"] +[color = "#fff6d5"] +== Dealing with interruptions + +== Git stash command + +- put changes away temporarily +- https://git-scm.com/docs/git-stash + + +[background-color = "#124990"] +[color = "#fff6d5"] +== Summary + + +include::{includedir}footer.adoc[] \ No newline at end of file -- GitLab