SlideShare a Scribd company logo
1 of 18
Hands-on GitHub Tutorial
Introduction to Git and GitHub
GDSC
IIIT Ranchi
After hearing about Git and Github
What is Git?
Git is a Version Control System (VCS) designed to make it
easier to have multiple versions of a code base,
sometimes across multiple developers or teams.
It allows you to see changes you make to your code and
easily revert them.
It is NOT GITHUB!
Ok, then what is Github?
github.com is a website that hosts git repositories on a
remote server.
Hosting repositories on Github facilitates the sharing of
codebases among teams by providing a GUI to easily fork
or clone repos to a local machine.
By pushing your repositories to Github, you will pretty
much automatically create your own developer portfolio
as well!
You can interact with Git using the Graphical User Interface (GUI)
provided by GitHub, or through the Command Line Interface (CLI).
Github Walkthrough
Tracking Files
Working with Command Line(CLI)
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)
Elementary Commands
git commit –m/-a
creates a new commit
commit message is required!
-m for commiting all staged content
–a for not just staged but all modified files
git status
displays difference between current state and last commit
displays all changed files including their states (untracked, modified, staged)
git log
lists the history of commits in the current branch
unique commit identifier
who made the commit
date and time
commit messages
additional information
there are many options for displaying commit history in different formats
Working with remote repositories
git fetch
this command copies the commits done in the remote repository to the remote branches
git pull
fetches the remote branch and automatically tries to merge it to the current local branch
git push
makes our local changes visible in remote repository
git merge <branch_name>
merging specified branch with the current one
git branch <new_branch>
command for creating new branch with given name
option –b for switching to new branch
Merge conflicts
git with VS Code
Untracked File Status (U):
Files not yet added to repository.
VS Code displays a U beside the filename.
Unmodified File Status:
Tracked files that have not been changed.
Modified File Status (M):
Tracked files that have been changed.
VS Code displays an M beside the filename
Ignore File Status:
Files that match a pattern or exact match in .gitignore
VS Code grays out the filename.
Staged File Status (A):
Tracked files that have been added.
VS Code displays an A beside the filename.
github_gyan.pptx

More Related Content

Similar to github_gyan.pptx

Similar to github_gyan.pptx (20)

Git and Github - A primer
Git and Github - A primerGit and Github - A primer
Git and Github - A primer
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git and github
Git and githubGit and github
Git and github
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptx
 
Advanced Web Development in PHP - Code Versioning and Branching with Git
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
 
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 ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
Rc094 010d-git 2 - desconocido
Rc094 010d-git 2 - desconocidoRc094 010d-git 2 - desconocido
Rc094 010d-git 2 - desconocido
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Version controll.pptx
Version controll.pptxVersion controll.pptx
Version controll.pptx
 
Git 101
Git 101Git 101
Git 101
 
Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
 
Git presentation
Git presentationGit presentation
Git presentation
 
Git basic
Git basicGit basic
Git basic
 
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucketIntro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
 
Git
GitGit
Git
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 

Recently uploaded

Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 

Recently uploaded (20)

Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 

github_gyan.pptx

  • 1. Hands-on GitHub Tutorial Introduction to Git and GitHub GDSC IIIT Ranchi
  • 2. After hearing about Git and Github
  • 3. What is Git? Git is a Version Control System (VCS) designed to make it easier to have multiple versions of a code base, sometimes across multiple developers or teams. It allows you to see changes you make to your code and easily revert them. It is NOT GITHUB!
  • 4. Ok, then what is Github? github.com is a website that hosts git repositories on a remote server. Hosting repositories on Github facilitates the sharing of codebases among teams by providing a GUI to easily fork or clone repos to a local machine. By pushing your repositories to Github, you will pretty much automatically create your own developer portfolio as well!
  • 5. You can interact with Git using the Graphical User Interface (GUI) provided by GitHub, or through the Command Line Interface (CLI).
  • 7.
  • 8.
  • 10. Working with Command Line(CLI)
  • 11. 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)
  • 12. Elementary Commands git commit –m/-a creates a new commit commit message is required! -m for commiting all staged content –a for not just staged but all modified files git status displays difference between current state and last commit displays all changed files including their states (untracked, modified, staged) git log lists the history of commits in the current branch unique commit identifier who made the commit date and time commit messages additional information there are many options for displaying commit history in different formats
  • 13. Working with remote repositories git fetch this command copies the commits done in the remote repository to the remote branches git pull fetches the remote branch and automatically tries to merge it to the current local branch git push makes our local changes visible in remote repository git merge <branch_name> merging specified branch with the current one git branch <new_branch> command for creating new branch with given name option –b for switching to new branch
  • 15.
  • 16.
  • 17. git with VS Code Untracked File Status (U): Files not yet added to repository. VS Code displays a U beside the filename. Unmodified File Status: Tracked files that have not been changed. Modified File Status (M): Tracked files that have been changed. VS Code displays an M beside the filename Ignore File Status: Files that match a pattern or exact match in .gitignore VS Code grays out the filename. Staged File Status (A): Tracked files that have been added. VS Code displays an A beside the filename.