GDSC - Introduction to GIT

Introduction to Git
Sonja Glišović
Viktor Katzenberger
University of Belgrade
What is Git?
Git is Version Control System (VCS) responsible for managing changes in
files and keeping historical copies.
It was created in 2005. by Linux community in order to provide
collaboration between a lot of geographically distant programmers who
worked on the development of the linux kernel.
Git is now one of the most popular version control systems out there and
is used in millions of projects.
It is a free open source system available for installation on Unix based
platforms, windows and macOS
GitHub
It was created in 2007.
Web-based hosting platform for software development and version
control using Git.
It provides access control and many other features such as bug tracking,
task management etc.
Commonly used as a host for open source projects.
There are also features characteristic for social networks ( followers,
feed…).
Over 50 millions of users in this moment.
Elementary commands
git config
command for setting information such as name or e-mail address
option --global for setting information globally for all repositories
git init
initializes git repository locally
git clone <repo_url>
command for cloning remote repository from hosting service
git add <file_name>
command for adding specified file to the list of changes to be
committed (staging area)
option --all for adding all modified files to the staging area ( .gitignore
file for exceptions )
git commit
creates a new commit
commit message is required, it can be specified in command by option
–m followed by message text
message should contain all of the relevant information about
commit!
option –a for committing not just staged but all modified files
git status
displays differences between current state and last commit
displays all changed files including their states ( untracked, modified,
staged ), files specified in .gitignore are not shown here
git log
lists the history of commits in the current branch
unique commit identifier
who made this commit
date and time
commit message
additional information
there are many options for displaying commit history in different
formats
git diff
shows all modifications in tracked files ( in modified state )
option --staged for showing differences in staged files
git commit --amend
updates previous commit
in the background it creates completely different commit with different identifier
which should replace the previous one
Branches
Creating separate branches for different features
Making changes in code independent of the main branch
Switching from one branch to another
Merging
Branch commands
git branch
existing branches are listed, current branch is highlighted and marked
with an asterisk
git branch <new_branch_name>
command for creating new branch with given name
option –b for switching to new branch
git checkout <branch_name>
command for switching to specified branch
git merge <branch_name>
merging specified branch with the current one
Merge conflicts
Moving through history
Git allows you to retrieve an earlier version
git checkout <commit_id>
return to the version specified by the commit identifier
Instead of the previous command we can refer a commit using offset
relative to the last commit in branch or HEAD pointer
git checkout HEAD~2 ( git checkout HEAD^^ )
These two command are equivalent, in this example offset relative to
HEAD pointer is 2
Working with remote repositories
git fetch
this command copies the commits done in the remote repository to
the remote branches and now they are reflected locally
git pull
fetches the remote branch and automatically tries to merge it to the
current local branch, actually we have fetch and merge in single
command
git push
makes our local changes visible in remote repository
Interacting with Git through Git GUI
Interacting with Git through Git GUI
Interacting with Git through Git GUI
Thank You!
1 von 16

Recomendados

Introduction to github slideshare von
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshareRakesh Sukumar
24.7K views9 Folien
Git and GitHub | Concept about Git and GitHub Process | Git Process overview von
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewRueful Robin
399 views21 Folien
Introduction to Git von
Introduction to GitIntroduction to Git
Introduction to GitYan Vugenfirer
14.4K views35 Folien
Git-flow workflow and pull-requests von
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requestsBartosz Kosarzycki
16.1K views27 Folien
Git and Github Session von
Git and Github SessionGit and Github Session
Git and Github SessionGoogleDevelopersStud1
505 views20 Folien
GitHub Basics - Derek Bable von
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable"FENG "GEORGE"" YU
984 views34 Folien

Más contenido relacionado

Was ist angesagt?

Git flow Introduction von
Git flow IntroductionGit flow Introduction
Git flow IntroductionDavid Paluy
9.4K views15 Folien
Git in 10 minutes von
Git in 10 minutesGit in 10 minutes
Git in 10 minutesSafique Ahmed Faruque
1.6K views13 Folien
Git Introduction Tutorial von
Git Introduction TutorialGit Introduction Tutorial
Git Introduction TutorialThomas Rausch
3.9K views148 Folien
Learning Git and GitHub - BIT GDSC.pdf von
Learning Git and GitHub - BIT GDSC.pdfLearning Git and GitHub - BIT GDSC.pdf
Learning Git and GitHub - BIT GDSC.pdfJayprakash677449
190 views16 Folien
Intro to Git and GitHub von
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHubPanagiotis Papadopoulos
2.7K views31 Folien

Was ist angesagt?(20)

Git flow Introduction von David Paluy
Git flow IntroductionGit flow Introduction
Git flow Introduction
David Paluy9.4K views
Git Introduction Tutorial von Thomas Rausch
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
Thomas Rausch3.9K views
Learning Git and GitHub - BIT GDSC.pdf von Jayprakash677449
Learning Git and GitHub - BIT GDSC.pdfLearning Git and GitHub - BIT GDSC.pdf
Learning Git and GitHub - BIT GDSC.pdf
Jayprakash677449190 views
Introduction to Git Commands and Concepts von Carl Brown
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and Concepts
Carl Brown2.9K views
Git hub ppt presentation von AyanaRukasar
Git hub ppt presentationGit hub ppt presentation
Git hub ppt presentation
AyanaRukasar504 views
Git One Day Training Notes von glen_a_smith
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith3.5K views
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ... von Simplilearn
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Simplilearn5.9K views
Git branching strategies von jstack
Git branching strategiesGit branching strategies
Git branching strategies
jstack5.2K views

Similar a GDSC - Introduction to GIT

github_gyan.pptx von
github_gyan.pptxgithub_gyan.pptx
github_gyan.pptxAyushSingh931502
51 views18 Folien
Introduction to Git & GitHub von
Introduction to Git & GitHubIntroduction to Git & GitHub
Introduction to Git & GitHubWasit Shafi
19 views15 Folien
Advanced Web Development in PHP - Code Versioning and Branching with Git von
Advanced Web Development in PHP - Code Versioning and Branching with GitAdvanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitRasan Samarasinghe
405 views42 Folien
Git Commands Every Developer Should Know? von
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?9 series
138 views67 Folien
GDSC23 - Github Workshop Presentation.pptx von
GDSC23 - Github Workshop Presentation.pptxGDSC23 - Github Workshop Presentation.pptx
GDSC23 - Github Workshop Presentation.pptxChitreshGyanani1
40 views15 Folien
Git cheat sheet von
Git cheat sheetGit cheat sheet
Git cheat sheetLam Hoang
49 views3 Folien

Similar a GDSC - Introduction to GIT(20)

Introduction to Git & GitHub von Wasit Shafi
Introduction to Git & GitHubIntroduction to Git & GitHub
Introduction to Git & GitHub
Wasit Shafi19 views
Advanced Web Development in PHP - Code Versioning and Branching with Git von Rasan Samarasinghe
Advanced Web Development in PHP - Code Versioning and Branching with GitAdvanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with Git
Rasan Samarasinghe405 views
Git Commands Every Developer Should Know? von 9 series
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
9 series138 views
GDSC23 - Github Workshop Presentation.pptx von ChitreshGyanani1
GDSC23 - Github Workshop Presentation.pptxGDSC23 - Github Workshop Presentation.pptx
GDSC23 - Github Workshop Presentation.pptx
ChitreshGyanani140 views
Git cheat sheet von Lam Hoang
Git cheat sheetGit cheat sheet
Git cheat sheet
Lam Hoang49 views
Git_and_GitHub Integration_with_Guidewire von Gandhi Ramu
Git_and_GitHub Integration_with_GuidewireGit_and_GitHub Integration_with_Guidewire
Git_and_GitHub Integration_with_Guidewire
Gandhi Ramu628 views
Rc094 010d-git 2 - desconocido von Luis Bertel
Rc094 010d-git 2 - desconocidoRc094 010d-git 2 - desconocido
Rc094 010d-git 2 - desconocido
Luis Bertel1.7K views
Git 入门与实践 von Terry Wang
Git 入门与实践Git 入门与实践
Git 入门与实践
Terry Wang478 views
Git 入门 与 实践 von Terry Wang
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
Terry Wang1.3K views
Git Session 2K23.pptx von Eshaan35
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptx
Eshaan35250 views
Hacktoberfest intro to Git and GitHub von DSC GVP
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
DSC GVP149 views

Último

7 NOVEL DRUG DELIVERY SYSTEM.pptx von
7 NOVEL DRUG DELIVERY SYSTEM.pptx7 NOVEL DRUG DELIVERY SYSTEM.pptx
7 NOVEL DRUG DELIVERY SYSTEM.pptxSachin Nitave
61 views35 Folien
UNIDAD 3 6º C.MEDIO.pptx von
UNIDAD 3 6º C.MEDIO.pptxUNIDAD 3 6º C.MEDIO.pptx
UNIDAD 3 6º C.MEDIO.pptxMarcosRodriguezUcedo
124 views32 Folien
Psychology KS4 von
Psychology KS4Psychology KS4
Psychology KS4WestHatch
90 views4 Folien
When Sex Gets Complicated: Porn, Affairs, & Cybersex von
When Sex Gets Complicated: Porn, Affairs, & CybersexWhen Sex Gets Complicated: Porn, Affairs, & Cybersex
When Sex Gets Complicated: Porn, Affairs, & CybersexMarlene Maheu
73 views73 Folien
CONTENTS.pptx von
CONTENTS.pptxCONTENTS.pptx
CONTENTS.pptxiguerendiain
57 views17 Folien
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively von
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyPECB
598 views18 Folien

Último(20)

7 NOVEL DRUG DELIVERY SYSTEM.pptx von Sachin Nitave
7 NOVEL DRUG DELIVERY SYSTEM.pptx7 NOVEL DRUG DELIVERY SYSTEM.pptx
7 NOVEL DRUG DELIVERY SYSTEM.pptx
Sachin Nitave61 views
Psychology KS4 von WestHatch
Psychology KS4Psychology KS4
Psychology KS4
WestHatch90 views
When Sex Gets Complicated: Porn, Affairs, & Cybersex von Marlene Maheu
When Sex Gets Complicated: Porn, Affairs, & CybersexWhen Sex Gets Complicated: Porn, Affairs, & Cybersex
When Sex Gets Complicated: Porn, Affairs, & Cybersex
Marlene Maheu73 views
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively von PECB
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
PECB 598 views
Drama KS5 Breakdown von WestHatch
Drama KS5 BreakdownDrama KS5 Breakdown
Drama KS5 Breakdown
WestHatch87 views
The Accursed House by Émile Gaboriau von DivyaSheta
The Accursed House  by Émile GaboriauThe Accursed House  by Émile Gaboriau
The Accursed House by Émile Gaboriau
DivyaSheta212 views
Education and Diversity.pptx von DrHafizKosar
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptx
DrHafizKosar177 views
Structure and Functions of Cell.pdf von Nithya Murugan
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdf
Nithya Murugan701 views
Psychology KS5 von WestHatch
Psychology KS5Psychology KS5
Psychology KS5
WestHatch103 views
Ch. 8 Political Party and Party System.pptx von Rommel Regala
Ch. 8 Political Party and Party System.pptxCh. 8 Political Party and Party System.pptx
Ch. 8 Political Party and Party System.pptx
Rommel Regala53 views
Classification of crude drugs.pptx von GayatriPatra14
Classification of crude drugs.pptxClassification of crude drugs.pptx
Classification of crude drugs.pptx
GayatriPatra1492 views
Solar System and Galaxies.pptx von DrHafizKosar
Solar System and Galaxies.pptxSolar System and Galaxies.pptx
Solar System and Galaxies.pptx
DrHafizKosar94 views
REPRESENTATION - GAUNTLET.pptx von iammrhaywood
REPRESENTATION - GAUNTLET.pptxREPRESENTATION - GAUNTLET.pptx
REPRESENTATION - GAUNTLET.pptx
iammrhaywood107 views

GDSC - Introduction to GIT

  • 1. Introduction to Git Sonja Glišović Viktor Katzenberger University of Belgrade
  • 2. What is Git? Git is Version Control System (VCS) responsible for managing changes in files and keeping historical copies. It was created in 2005. by Linux community in order to provide collaboration between a lot of geographically distant programmers who worked on the development of the linux kernel. Git is now one of the most popular version control systems out there and is used in millions of projects. It is a free open source system available for installation on Unix based platforms, windows and macOS
  • 3. GitHub It was created in 2007. Web-based hosting platform for software development and version control using Git. It provides access control and many other features such as bug tracking, task management etc. Commonly used as a host for open source projects. There are also features characteristic for social networks ( followers, feed…). Over 50 millions of users in this moment.
  • 4. Elementary commands git config command for setting information such as name or e-mail address option --global for setting information globally for all repositories git init initializes git repository locally git clone <repo_url> command for cloning remote repository from hosting service
  • 5. git add <file_name> command for adding specified file to the list of changes to be committed (staging area) option --all for adding all modified files to the staging area ( .gitignore file for exceptions ) git commit creates a new commit commit message is required, it can be specified in command by option –m followed by message text message should contain all of the relevant information about commit! option –a for committing not just staged but all modified files
  • 6. git status displays differences between current state and last commit displays all changed files including their states ( untracked, modified, staged ), files specified in .gitignore are not shown here git log lists the history of commits in the current branch unique commit identifier who made this commit date and time commit message additional information there are many options for displaying commit history in different formats
  • 7. git diff shows all modifications in tracked files ( in modified state ) option --staged for showing differences in staged files git commit --amend updates previous commit in the background it creates completely different commit with different identifier which should replace the previous one
  • 8. Branches Creating separate branches for different features Making changes in code independent of the main branch Switching from one branch to another Merging
  • 9. Branch commands git branch existing branches are listed, current branch is highlighted and marked with an asterisk git branch <new_branch_name> command for creating new branch with given name option –b for switching to new branch git checkout <branch_name> command for switching to specified branch
  • 10. git merge <branch_name> merging specified branch with the current one Merge conflicts
  • 11. Moving through history Git allows you to retrieve an earlier version git checkout <commit_id> return to the version specified by the commit identifier Instead of the previous command we can refer a commit using offset relative to the last commit in branch or HEAD pointer git checkout HEAD~2 ( git checkout HEAD^^ ) These two command are equivalent, in this example offset relative to HEAD pointer is 2
  • 12. Working with remote repositories git fetch this command copies the commits done in the remote repository to the remote branches and now they are reflected locally git pull fetches the remote branch and automatically tries to merge it to the current local branch, actually we have fetch and merge in single command git push makes our local changes visible in remote repository
  • 13. Interacting with Git through Git GUI
  • 14. Interacting with Git through Git GUI
  • 15. Interacting with Git through Git GUI