Git basic introduction & tutorial for begginer
AnDiLestiAnto2
8 views
14 slides
Jul 03, 2024
Slide 1 of 14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
About This Presentation
Git basic introduction
Size: 564.34 KB
Language: en
Added: Jul 03, 2024
Slides: 14 pages
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
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