Git basic introduction & tutorial for begginer

AnDiLestiAnto2 8 views 14 slides Jul 03, 2024
Slide 1
Slide 1 of 14
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14

About This Presentation

Git basic introduction


Slide Content

Git Basic
Introduction of GIT
Created By: Ryan Pramana

What is GIT?
Git is the most popular version control system. Git tracks the changes you make to
files, so you have a record of what has been done, and you can revert to specific
versions should you ever need to. With version control system, we can track software
development history and also can easily do collaborative work.

Git As a Distributed Version Control System

Local Repository Workflow
Repository (“Repo”) is object database of the project, storing everything
needed from the project such as file, folder, version, history of commits,
deletions, etc

Local Repository Workflow
Index - Files that have been changed, added and deleted will be staged
within the index until you are ready to commit the files. To see what is set in
your Git index, run git status within your repository
Head - a reference variable used to denote the most current commit of the
repository in which you are working

git add <filename>

git add *

git commit -m "Commit message"

Remote Repository Workflow
git remote add origin <server>

git push origin master

Branching Command
git checkout -b <branch-name>

git checkout <branch-name>
git branch -d feature_x
git push origin <branch>
Create new branch
Switch to spesific
branch
Delete branch
Push branch to
remote repo

Update and Merge
git pull
git merge <branch>
git add <filename>
git diff <source_branch>
<target_branch>

Update Git
Merge another branch to
current branch
Add merged file
Check conflict

Merging Best Practice (Especially for production stage)
●Merge Origin/master to your branch first
●Resolve conflict in your branch and make sure all code works well (tips: do
sanity check)
●push merged code in your branch
●switch to master branch
●merge the prev mergered code to master (in this merge state, there is no
conflict will occur because all conflict already solved in prev merge)

Replace local changes (In case did something wrong)

git checkout -- <filename>

git fetch origin
git reset --hard origin/master

Replace file with last content
in HEAD
Drop all local
changes and
fetch from latest
remote repo

Remote version control system

GIT Acsess Application

Demo GitKraken

Reference
●https://www.freecodecamp.org/news/what-is-git-and-how-to-use-it-c341b049ae
61/
●https://www.youtube.com/watch?v=2ReR1YJrNOM
●https://www.nobledesktop.com/blog/what-is-git-and-why-should-you-use-it
●https://rogerdudler.github.io/git-guide/
●https://acloudguru.com/blog/engineering/git-terms-explained#index
Tags