SlideShare a Scribd company logo
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
GITAcsess 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

More Related Content

PDF
PPTX
Hacktoberfest intro to Git and GitHub
DOCX
Git github
PDF
Git cheat sheet__grey
PDF
Git cheat sheet__white
PDF
Git cheat sheet_dark
PPTX
git command and concepts for everyone.pptx
PDF
Improving your workflow with git
Hacktoberfest intro to Git and GitHub
Git github
Git cheat sheet__grey
Git cheat sheet__white
Git cheat sheet_dark
git command and concepts for everyone.pptx
Improving your workflow with git

Similar to Git basic introduction & tutorial for begginer (20)

PDF
Git basics
PPTX
Git and Github
PPSX
Advanced Web Development in PHP - Code Versioning and Branching with Git
PPTX
Git and github
PDF
Git cheat sheet
PDF
Git slides
PPTX
Git and Github workshop GDSC MLRITM
PPTX
GIT.pptx
PDF
Collaborative development with Git | Workshop
PPTX
Version control git day03
PDF
Git basics for beginners
PPTX
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
PPTX
Version control git day02
PDF
SVN 2 Git
PDF
Git and Github - A primer
PPTX
Git&GitHub.pptx
PPTX
Demystifying Git
PPTX
Demystifying Git
PDF
Introducing Git and git flow
PPTX
Git 101
Git basics
Git and Github
Advanced Web Development in PHP - Code Versioning and Branching with Git
Git and github
Git cheat sheet
Git slides
Git and Github workshop GDSC MLRITM
GIT.pptx
Collaborative development with Git | Workshop
Version control git day03
Git basics for beginners
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Version control git day02
SVN 2 Git
Git and Github - A primer
Git&GitHub.pptx
Demystifying Git
Demystifying Git
Introducing Git and git flow
Git 101
Ad

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Electronic commerce courselecture one. Pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
cuic standard and advanced reporting.pdf
PPT
Teaching material agriculture food technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectroscopy.pptx food analysis technology
Digital-Transformation-Roadmap-for-Companies.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Understanding_Digital_Forensics_Presentation.pptx
Big Data Technologies - Introduction.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Electronic commerce courselecture one. Pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Network Security Unit 5.pdf for BCA BBA.
The Rise and Fall of 3GPP – Time for a Sabbatical?
cuic standard and advanced reporting.pdf
Teaching material agriculture food technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Ad

Git basic introduction & tutorial for begginer

  • 1. Git Basic Introduction of GIT Created By: Ryan Pramana
  • 2. 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.
  • 3. Git As a Distributed Version Control System
  • 4. 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
  • 5. 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"
  • 6. Remote Repository Workflow git remote add origin <server> git push origin master
  • 7. 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
  • 8. 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
  • 9. 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)
  • 10. 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
  • 14. 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