zeger-jan van de weg starting with git and gitlab · lets use the terminal again. working together...
TRANSCRIPT
![Page 1: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/1.jpg)
Starting with git and GitLabZeger-Jan van de Weg
![Page 2: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/2.jpg)
What is git?
Version Control System
- Contains history of the codebase
- Directed graph state to all other states
- Offline
- But online single source of truth
- Distributed
- Using snapshots
![Page 3: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/3.jpg)
● (I use the CLI exclusively recommend you to do the same)
Let’s get started
![Page 4: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/4.jpg)
● Diverge from a chosen point in history
○ Isolates changes
○ Feature branches
○ git can track how to merge
Branching
![Page 5: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/5.jpg)
New Branch
● $ git branch iss53
● $ git checkout iss53
![Page 6: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/6.jpg)
After one commit
![Page 7: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/7.jpg)
Another feature branch
● $ git checkout -b hotfix
● $ vim email.rb
● $ git commit -a -m ‘Fixed the broken email address’
![Page 8: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/8.jpg)
Basic merge - Fast forward merging
● $ git checkout master
● $ git merge hotfix
![Page 9: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/9.jpg)
Basic merge - Merge commit
● $ git checkout master
● $ git merge iss53
○ How does git resolve this?
![Page 10: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/10.jpg)
Basic merge - Merge commit
● Cleanup:
○ $ git branch --delete iss53
![Page 11: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/11.jpg)
Basic merge - Merge Conflicts
● What if multiple commits edit the same file?
○ Merge conflicts!
● Lets use the terminal again
![Page 12: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/12.jpg)
Working together
● You need a source of truth
○ GitLab!
● First, let’s setup GitLab for our team
![Page 13: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/13.jpg)
Working with Remotes
● $ git remote add [email protected]:group/project.git
● $ git push
○ $ git clone
![Page 14: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/14.jpg)
Syncing changes
● Your changes to upstream
○ $ git push --set-upstream origin <branch-name>
● Pulling changes from upstream
○ $ git pull
●
![Page 15: Zeger-Jan van de Weg Starting with git and GitLab · Lets use the terminal again. Working together You need a source of truth GitLab! First, let’s setup GitLab for our team. Working](https://reader034.vdocuments.us/reader034/viewer/2022050216/5f61dfc07cd03366c5432283/html5/thumbnails/15.jpg)
Questions?
● Further reading:
○ ProGit
○ GitLab Flow
● Feature Proposals || Bugs
○ https://gitlab.com/gitlab-org/gitlab-ce/issues
● Email: [email protected]