Preparation
1
app.sli.do/event/7MA9DDoeyu11QTWMAc33ME
101
2
Agenda 3.3.2024
1. Version Control System
2. Get started with Git�3. Basic commands�4. Git Workflow
5. Continuous Integration (CI) Introduction�6. Demo: CI/CD a Static Site Generator webpage
3
Version Control System
4
I'll in charge!
Why need using Git
5
Chinh's code
v1.0.0
v1.0.1
v1.0.2
Thang's code
v1.0.0
v1.0.1
v1.0.2
Before git
Centralized Version Control System
6
Single point of failure
Slow speed
Performance limitations
Doesn’t scale
Waste of resources
Centralized VCS
7
Chinh's code
v1.0.0
v1.0.1
v1.0.2
Thang's code
v1.0.0
v1.0.1
v1.0.2
v1.0.2
Before git
After git
8
What is Git?
9
Distributed SCM
Collaborative coding
Who made Git
10
Father of Linux
Linus Torvalds
Love penguins
Git as a Service
11
12
INSTALLATION
MacOS: brew install git�Debian: apt-get install git�Fedora: yum/dnf install git�Alpine: apk add git�Windows: https://git-scm.com/download/win�
https://git-scm.com/download
13
INSTALLATION
14
CHECK GIT VERSION
Getting Started with Github
15
16
GIT MUST-CONFIG
17
GENERATE SSH KEY
A Repository
18
Store source code of your one project
Recognized by .git folder
Local / Remote Repo
will be explain next slide
How Git works
19
Git Clone
20
= Download your repo
Add & Commit & Push
21
I want theses changes
Oh, I want that changes on my local
Ready to change for remote repo
Example: Update changes with 3 legends: add, commit, push
22
Example of .git
23
and I will show you what inside it
Fork
24
Git as a Service
25
https://sapling-scm.com/docs/introduction/
Lazygit
26
Practice repo
27
github.com/GDSC-HCMUS/GDSCxSAB-cs101-git
28
Tea Break & QnA
Git Workflow
29
Let me handle this…
The Three States of Git
30
3 states of local changes
Default branch checkout
Git Branch
31
Core power of Git
A copied version of your main code
Develop new feature, or bug fix
Git Branches Example
32
Checkout a branch
33
Pull Request = Request to update my changes from my branch
Pull Request Simple Explain
34
Pull Request Process
35
Pull Request Process
36
Review code
Open PR
Approve PR
= Updated changes
Pull Request (PR) Example
37
Pull Request (PR) Example
38
PR title and PR number
Who open PR and what they changes
Pull Request (PR) Example
39
Source branch and dest branch
Reviewer and Approver
Review code example
40
Pull Request (PR) Example
41
Git Conflict
42
After Merge Conflict
43
Source: BH!J33T
Workflow with Git
44
Trunk-based
GitFlow
https://www.toptal.com/software/trunk-based-development-git-flow
45
Trunk-based
Good for small projects
Reduce time consuming
Micromanagement
Development quickly
46
GitFlow
Professional / Open Source
Lots of multilevel developers
Need lots of Scrum exp
Development stable
GitKraken
47
CI/CD Git Development
48
Hola
GitOps
49
Continuous Integration (CI)
50
Continuous Delivery/Deployment (CD)
51
Tools
52
Let me handle this…
or other tools
Real-life Example: Android / App Development
or other tools
Real-life Example: Android / App Development
Event
or other tools
Real-life Example: Android / App Development
Automation Test
CI
Event
or other tools
Real-life Example: Android / App Development
Automation Test
CI
CD
Event
57
DEMO
I’ll demo
Practice repo & QnA
58
github.com/GDSC-HCMUS/GDSCxSAB-cs101-git