SlideShare a Scribd company logo
INTRODUCTION TO
GIT/GITHUB
Version Control with Git
• What do you do when you want to recover past versions of a file?
Version Control with Git .. Cntd
•Using Git,
• You can easily view the history of your source code.
• Track difference between different versions of your files.
• Git will prevent an unintentional overwrites.
Popular Version Control Systems
• Client-server model – Developers use a shared single
repository
• Subversion (SVN)
• Visual Studio Team Services (VSTS)
• Distributed model- Each developer works directly with his or
her own local repository, and changes are shared between
repositories as a separate step
• Bazaar
• Git
What is GitHub?
• A Web-Based Git Repository hosting service, that offers all of the
distributed revision control and source code management functionalities
It allows you to:
• Share your repositories with others
• Access other user’s repositories
• Store remote copies of your repositories
Repository to Control History
• Remote Repository: Resides on a remote server that is shared
among team members. (e.g.- GitHub)
• Local Repository: Resides on a local machine of an individual
user.
• You can either create a brand new repository or from scratch or by
cloning an existing remote repository onto your local machine.
Commits
• Enables you to record changes that were made to a file or directory.
• You can view all changes chronologically in the respective file or directory.
• It is easy to team members to understand why and how changes were made.
• Provide a descriptive commit message regarding the changes you have made.
Installing Git
• Windows: git-scm.com/download/win
• Mac: git-scm.com/mac
• Linux: sudo apt-get install git (Ubuntu)
or sudo yum install git (Fedora)
Once installed check Git Version: git --version
Default Settings
• Your Identity
• Enable Color in git
Create a new Repository
• Initialize the local directory as a Git repository
Create a new Repository .. Cntd
• Add & Commit
• Commit Changes
Push a remote Repository
• Allows us to share our changes with other members in the team.
✓Push
To sharing our changes with others, we have to push them to remote
repository.This will cause the remote repository to update and synchronized
with out local repository.
Push a remote Repository .. Cntd
• Add the URL for the remote repository
• Push the changes from your local repository to GitHub
Origin
• A name for the remote repository that a project was originally
cloned from.
• Not required to name the remote repository Origin
Clone a remote Repository
✓Clone
Copy a remote repository to local machine
Pull from a remote Repository
• Synchronized local repository with the newly updated remote
repository
What’s a Branch?
• Independent line of development.
• Enables you to isolate your work from others.
• Easily merge the versions later on.
Branch .. Cntd
• Create a new branch
• Switch to different branch
Merge Branches
• Combine two branches.
• Checkout the branch you want to update.
• Execute the merge
Merge Conflict
• Occurs when, two or more members make changes on the same
part of a file in the two different branches.
• Git unable to resolve the merge conflicts.
• We have to manually fix them.
Resolve a Conflict
• Delete the conflict markers <<<<<<<, =======, >>>>>>> and
make the changes you want in the final merge.
Resolve merge conflict from
terminal
• Run the following commands in your terminal
git config merge.tool vimdiff
git config merge.conflictstyle diff3
git config mergetool.prompt false
git mergetool
• Vimdiff display
More ..
• Delete a branch
• View all the available branches
• Examine the repository history
References
• https://guides.github.com/introduction/flow/
• https://en.wikipedia.org/wiki/List_of_version_control_software
• https://backlog.com/git-tutorial/
• https://stackoverflow.com/questions/161813/how-to-resolve-merge-conflicts-
in-git
• https://help.github.com/articles/resolving-a-merge-conflict-using-the-
command-line/
• https://stackoverflow.com/questions/13321556/difference-between-git-and-
github
Introduction to git

More Related Content

PPTX
Git vs svn
PPTX
Svn vs mercurial vs github
PPTX
Presentation on Repository Control System
PPTX
Git hub_pptx
PDF
Introduction to Containers
PPTX
Concepts of Open source
KEY
Git with bitbucket (draft)
PPTX
Git Basics
Git vs svn
Svn vs mercurial vs github
Presentation on Repository Control System
Git hub_pptx
Introduction to Containers
Concepts of Open source
Git with bitbucket (draft)
Git Basics

What's hot (20)

PPT
Introduction to git
PPTX
Getting Started with Git: A Primer for SVN and TFS Users
PPTX
Kubernetes Workshop
PDF
Introduction to Git
PPTX
Git for a newbie
PDF
Hg for bioinformatics, second part
PDF
Leverage LXC/LXD with Kubernetes
PPTX
Kubernetes
PDF
Fall18 Git presentation
PDF
Hands on docker
PPTX
Whats new in Windows Server 2012 R2 Hyper-V
PDF
Hg version control bioinformaticians
PPTX
Git in 10 minutes
PDF
A Closer Look at Kubernetes Pods and Replica Sets
PDF
Introduction to Containers and Docker for PHP developers
PPTX
PPTX
Introduction to kubernetes
PPTX
State of Builder and Buildkit by Tonis Tiigi (Docker)
PDF
DCA. certificate slide Session 1
PDF
Docker mentorweek
Introduction to git
Getting Started with Git: A Primer for SVN and TFS Users
Kubernetes Workshop
Introduction to Git
Git for a newbie
Hg for bioinformatics, second part
Leverage LXC/LXD with Kubernetes
Kubernetes
Fall18 Git presentation
Hands on docker
Whats new in Windows Server 2012 R2 Hyper-V
Hg version control bioinformaticians
Git in 10 minutes
A Closer Look at Kubernetes Pods and Replica Sets
Introduction to Containers and Docker for PHP developers
Introduction to kubernetes
State of Builder and Buildkit by Tonis Tiigi (Docker)
DCA. certificate slide Session 1
Docker mentorweek
Ad

Similar to Introduction to git (20)

PPTX
Git Session 2K23.pptx
PPTX
Git and Github and how can we leverage in Daily Coding
PPTX
PPTX
Intro to Git and Github
PPTX
Introduction to Git and Github
PDF
Git Mastery
PPTX
GitHub_For_Beginners_Presentationss.pptx
PDF
Git Pocket Guide A Working Introduction 1st Edition Richard E. Silverman
ZIP
Beginner's Guide to Version Control with Git
PDF
git-presentation.pdf
PPTX
Git and github
PDF
Git Init (Introduction to Git)
PDF
Git basics
PPTX
git github PPT_GDSCIIITK.pptx
PPTX
Mini-training: Let’s Git It!
PDF
Git and Github slides.pdf
PDF
Git and Github workshop ppt slide by slide
PPTX
Introduction to git hub
Git Session 2K23.pptx
Git and Github and how can we leverage in Daily Coding
Intro to Git and Github
Introduction to Git and Github
Git Mastery
GitHub_For_Beginners_Presentationss.pptx
Git Pocket Guide A Working Introduction 1st Edition Richard E. Silverman
Beginner's Guide to Version Control with Git
git-presentation.pdf
Git and github
Git Init (Introduction to Git)
Git basics
git github PPT_GDSCIIITK.pptx
Mini-training: Let’s Git It!
Git and Github slides.pdf
Git and Github workshop ppt slide by slide
Introduction to git hub
Ad

Recently uploaded (20)

PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
Empowerment Technology for Senior High School Guide
PDF
1_English_Language_Set_2.pdf probationary
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
RMMM.pdf make it easy to upload and study
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PPTX
Introduction to Building Materials
PDF
Trump Administration's workforce development strategy
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Orientation - ARALprogram of Deped to the Parents.pptx
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Empowerment Technology for Senior High School Guide
1_English_Language_Set_2.pdf probationary
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Paper A Mock Exam 9_ Attempt review.pdf.
Computing-Curriculum for Schools in Ghana
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
RMMM.pdf make it easy to upload and study
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
LDMMIA Reiki Yoga Finals Review Spring Summer
Introduction to Building Materials
Trump Administration's workforce development strategy

Introduction to git

  • 2. Version Control with Git • What do you do when you want to recover past versions of a file?
  • 3. Version Control with Git .. Cntd •Using Git, • You can easily view the history of your source code. • Track difference between different versions of your files. • Git will prevent an unintentional overwrites.
  • 4. Popular Version Control Systems • Client-server model – Developers use a shared single repository • Subversion (SVN) • Visual Studio Team Services (VSTS) • Distributed model- Each developer works directly with his or her own local repository, and changes are shared between repositories as a separate step • Bazaar • Git
  • 5. What is GitHub? • A Web-Based Git Repository hosting service, that offers all of the distributed revision control and source code management functionalities It allows you to: • Share your repositories with others • Access other user’s repositories • Store remote copies of your repositories
  • 6. Repository to Control History • Remote Repository: Resides on a remote server that is shared among team members. (e.g.- GitHub) • Local Repository: Resides on a local machine of an individual user. • You can either create a brand new repository or from scratch or by cloning an existing remote repository onto your local machine.
  • 7. Commits • Enables you to record changes that were made to a file or directory. • You can view all changes chronologically in the respective file or directory. • It is easy to team members to understand why and how changes were made. • Provide a descriptive commit message regarding the changes you have made.
  • 8. Installing Git • Windows: git-scm.com/download/win • Mac: git-scm.com/mac • Linux: sudo apt-get install git (Ubuntu) or sudo yum install git (Fedora) Once installed check Git Version: git --version
  • 9. Default Settings • Your Identity • Enable Color in git
  • 10. Create a new Repository • Initialize the local directory as a Git repository
  • 11. Create a new Repository .. Cntd • Add & Commit • Commit Changes
  • 12. Push a remote Repository • Allows us to share our changes with other members in the team. ✓Push To sharing our changes with others, we have to push them to remote repository.This will cause the remote repository to update and synchronized with out local repository.
  • 13. Push a remote Repository .. Cntd • Add the URL for the remote repository • Push the changes from your local repository to GitHub
  • 14. Origin • A name for the remote repository that a project was originally cloned from. • Not required to name the remote repository Origin
  • 15. Clone a remote Repository ✓Clone Copy a remote repository to local machine
  • 16. Pull from a remote Repository • Synchronized local repository with the newly updated remote repository
  • 17. What’s a Branch? • Independent line of development. • Enables you to isolate your work from others. • Easily merge the versions later on.
  • 18. Branch .. Cntd • Create a new branch • Switch to different branch
  • 19. Merge Branches • Combine two branches. • Checkout the branch you want to update. • Execute the merge
  • 20. Merge Conflict • Occurs when, two or more members make changes on the same part of a file in the two different branches. • Git unable to resolve the merge conflicts. • We have to manually fix them.
  • 21. Resolve a Conflict • Delete the conflict markers <<<<<<<, =======, >>>>>>> and make the changes you want in the final merge.
  • 22. Resolve merge conflict from terminal • Run the following commands in your terminal git config merge.tool vimdiff git config merge.conflictstyle diff3 git config mergetool.prompt false git mergetool • Vimdiff display
  • 23. More .. • Delete a branch • View all the available branches • Examine the repository history
  • 24. References • https://guides.github.com/introduction/flow/ • https://en.wikipedia.org/wiki/List_of_version_control_software • https://backlog.com/git-tutorial/ • https://stackoverflow.com/questions/161813/how-to-resolve-merge-conflicts- in-git • https://help.github.com/articles/resolving-a-merge-conflict-using-the- command-line/ • https://stackoverflow.com/questions/13321556/difference-between-git-and- github