Skip to content
Snippets Groups Projects
Commit 57d85eeb authored by George Adrian Stoica's avatar George Adrian Stoica
Browse files

edit: update lecture 10 slides

parent cec6bab5
No related branches found
No related tags found
No related merge requests found
Pipeline #234421 passed
= 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment