SlideShare a Scribd company logo
Workflow
an opinionated discussion
Grad Student, MIMS’14
Shreyas
seekshreyas
some slides adopted from and inspired by Scott Schacon’s
https://github.com/schacon/git-presentations
We’ve all been here ...
We’ve all been here ...
We’ve all been here ...
Problems
• multiple versions
• many contributors
• ...
conflicts
git + Github
a better workflow
git
git is an open source,
distributed version control
system designed for speed
and efficiency
git
git is an open source,
distributed version control
system designed for speed
and efficiency
git
git is an open source,
distributed version control
system designed for speed
and efficiency
git
git is an open source,
distributed version control
system designed for speed
and efficiency
(almost) everything is local
No Network needed for
(almost) everything is local
• Performing a diff
• Viewing file history
• Committing changes
• Merging branches
• Obtaining any other revision of a file
• Switching branches
git
git is an open source,
distributed version control
system designed for speed
and efficiency
http://bit.ly/git-linus-intro
ttp://bit.ly/git-advantages
More Advantages
.. and
• No .svn directories
• Independence
installing git
http://git-scm.com/downloads
getting setup ...
$ git config --global user.name
“<YOUR_NAME>”
$ git config --global user.email
“<YOUR_EMAIL>”
or edit them in ~/.gitconfig
lets dive in..
gitref.org/
• Creating New Repo
• Committing
• Branching/Merging
• InspectionCloning a
RepoUpdating
lets dive in..
• Creating New Repo
• Committing
• Branching/Merging
• Inspection
• Cloning a Repo
• Updating
http://git-scm.com/docs
Git Commands
$ git init
$ ls -al
$ git init
$ ls -al
$ mkdir workspace
$ cd workspace
Initialized empty Git repository in
../workspace/.git/
drwxr-xr-x 10 Shreyas staff 340 Jan 15
17:22 .git
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
Git Commands
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
$ cd .git
$ tree -a
Git Commands
$ git status
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
$ cd ..
$ touch testfile.md
branch
name
staging area
Git Commands
$ git add
<filename>
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
staging area
$ git status
Git Commands
$ git commit
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
your commit
msg
$ git status
Git Commands
$ git reset
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
(undo add)
changes staged
changes
unstaged
Git Commands
$ git reset --soft HEAD^
• Creating New
Repo
• Committing
• Branching/
Merging
• Updating
• Inspection
• Cloning A Repo
(undo a commit and
redo)
$ git reset --hard
HEAD~3
Rewind the branch to get rid of last three commits
http://git-scm.com/docs/git-r
eset
http://git-scm.com/docs/git-rev
ert.html
learn more here :
also refer
git revert :
http://git-scm.com/docs/git-sta
sh
git stash :
Git Commands
$ git rm <filename>
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
remove a file from the
repo
as expected, you will need to commit the
change
$ git mv <filename>
move/rename a file from the repo
as expected, you will need to commit the
change
Git Commands
$ git branch
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
list of branches
$ git branch
<branchname>
new branch
$ git checkout
<branchname>
switch
Git Commands
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
new branch
dev
switch branch
branch list
Git Commands
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
$ git merge
<branchname>
merge
branches
branch merge
Git Commands
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
$ git log
--graph
--decorate
--abbrev-commit
--all
--pretty=oneline
text-based graph :)
Git Commands
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
~/.gitconfig
[alias]
l = log --pretty=oneline -n 20 --
graph
Git Commands
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
$ gitk
Working with others...
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
github
GitHub
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
create an account
www.github.com/edu
GitHub
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
add ssh key
www.github.com/edu
GitHub
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
$ git clone <url>
<name>
https://github.com/jblomo/
datamining290
GitHub
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
Fork a repo
GitHub
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
$ git pull
$ git push
= git fetch + git merge
GitHub
• Creating New
Repo
• Committing
• Branching/
Merging
• Inspection
• Cloning a Repo
• Updating
GitHub Pull Request
GitHub Ninja Features
Markdown for documentation
Pages for project hosting
Gist for project hosting
Service Hooks ‘do something’ on commit
may the Force be with you

More Related Content

Similar to Git-GitHub.ppt Diploma in computer. engineering (20)

PDF
Git: a brief introduction
Randal Schwartz
 
PPTX
Intro to git and git hub
Venkat Malladi
 
PDF
Git Init (Introduction to Git)
GDSC UofT Mississauga
 
PPTX
11 git version control
Wasim Alatrash
 
PPT
Git presentation
James Cuzella
 
PDF
Source Code Management with Git
Things Lab
 
KEY
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
 
PPTX
Git_new.pptx
BruceLee275640
 
PPTX
sample.pptx
UshaSuray
 
PPT
390a gitintro 12au
Nguyen Van Hung
 
PDF
Did you git yet?
Michael Fong
 
PPTX
Git 101 - An introduction to Version Control using Git
John Tighe
 
PPT
Fundamentals and basics of Git and commands
DivyanshGupta922023
 
PPT
Git and fundamentals
Naincy Gupta
 
PDF
Collaborative development with Git | Workshop
Anuchit Chalothorn
 
PPTX
Git
Shinu Suresh
 
PDF
GIT Basics
Tagged Social
 
PDF
Advanced Git Tutorial
Sage Sharp
 
PDF
Git slides
Nanyak S
 
PPTX
Git workshop
Ray Toal
 
Git: a brief introduction
Randal Schwartz
 
Intro to git and git hub
Venkat Malladi
 
Git Init (Introduction to Git)
GDSC UofT Mississauga
 
11 git version control
Wasim Alatrash
 
Git presentation
James Cuzella
 
Source Code Management with Git
Things Lab
 
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
 
Git_new.pptx
BruceLee275640
 
sample.pptx
UshaSuray
 
390a gitintro 12au
Nguyen Van Hung
 
Did you git yet?
Michael Fong
 
Git 101 - An introduction to Version Control using Git
John Tighe
 
Fundamentals and basics of Git and commands
DivyanshGupta922023
 
Git and fundamentals
Naincy Gupta
 
Collaborative development with Git | Workshop
Anuchit Chalothorn
 
GIT Basics
Tagged Social
 
Advanced Git Tutorial
Sage Sharp
 
Git slides
Nanyak S
 
Git workshop
Ray Toal
 

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
PDF
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PDF
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
How to Manage Promotions in Odoo 18 Sales
Celine George
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
PPTX
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPTX
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
PPTX
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
How to Manage Promotions in Odoo 18 Sales
Celine George
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
Ad

Git-GitHub.ppt Diploma in computer. engineering

  • 1. Workflow an opinionated discussion Grad Student, MIMS’14 Shreyas seekshreyas some slides adopted from and inspired by Scott Schacon’s https://github.com/schacon/git-presentations
  • 2. We’ve all been here ...
  • 3. We’ve all been here ...
  • 4. We’ve all been here ...
  • 5. Problems • multiple versions • many contributors • ... conflicts
  • 6. git + Github a better workflow
  • 7. git git is an open source, distributed version control system designed for speed and efficiency
  • 8. git git is an open source, distributed version control system designed for speed and efficiency
  • 9. git git is an open source, distributed version control system designed for speed and efficiency
  • 10. git git is an open source, distributed version control system designed for speed and efficiency (almost) everything is local
  • 11. No Network needed for (almost) everything is local • Performing a diff • Viewing file history • Committing changes • Merging branches • Obtaining any other revision of a file • Switching branches
  • 12. git git is an open source, distributed version control system designed for speed and efficiency http://bit.ly/git-linus-intro ttp://bit.ly/git-advantages More Advantages
  • 13. .. and • No .svn directories • Independence
  • 15. getting setup ... $ git config --global user.name “<YOUR_NAME>” $ git config --global user.email “<YOUR_EMAIL>” or edit them in ~/.gitconfig
  • 16. lets dive in.. gitref.org/ • Creating New Repo • Committing • Branching/Merging • InspectionCloning a RepoUpdating
  • 17. lets dive in.. • Creating New Repo • Committing • Branching/Merging • Inspection • Cloning a Repo • Updating http://git-scm.com/docs
  • 18. Git Commands $ git init $ ls -al $ git init $ ls -al $ mkdir workspace $ cd workspace Initialized empty Git repository in ../workspace/.git/ drwxr-xr-x 10 Shreyas staff 340 Jan 15 17:22 .git • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating
  • 19. Git Commands • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating $ cd .git $ tree -a
  • 20. Git Commands $ git status • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating $ cd .. $ touch testfile.md branch name staging area
  • 21. Git Commands $ git add <filename> • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating staging area $ git status
  • 22. Git Commands $ git commit • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating your commit msg $ git status
  • 23. Git Commands $ git reset • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating (undo add) changes staged changes unstaged
  • 24. Git Commands $ git reset --soft HEAD^ • Creating New Repo • Committing • Branching/ Merging • Updating • Inspection • Cloning A Repo (undo a commit and redo) $ git reset --hard HEAD~3 Rewind the branch to get rid of last three commits http://git-scm.com/docs/git-r eset http://git-scm.com/docs/git-rev ert.html learn more here : also refer git revert : http://git-scm.com/docs/git-sta sh git stash :
  • 25. Git Commands $ git rm <filename> • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating remove a file from the repo as expected, you will need to commit the change $ git mv <filename> move/rename a file from the repo as expected, you will need to commit the change
  • 26. Git Commands $ git branch • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating list of branches $ git branch <branchname> new branch $ git checkout <branchname> switch
  • 27. Git Commands • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating new branch dev switch branch branch list
  • 28. Git Commands • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating $ git merge <branchname> merge branches branch merge
  • 29. Git Commands • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating $ git log --graph --decorate --abbrev-commit --all --pretty=oneline text-based graph :)
  • 30. Git Commands • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating ~/.gitconfig [alias] l = log --pretty=oneline -n 20 -- graph
  • 31. Git Commands • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating $ gitk
  • 32. Working with others... • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating github
  • 33. GitHub • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating create an account www.github.com/edu
  • 34. GitHub • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating add ssh key www.github.com/edu
  • 35. GitHub • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating $ git clone <url> <name> https://github.com/jblomo/ datamining290
  • 36. GitHub • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating Fork a repo
  • 37. GitHub • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating $ git pull $ git push = git fetch + git merge
  • 38. GitHub • Creating New Repo • Committing • Branching/ Merging • Inspection • Cloning a Repo • Updating GitHub Pull Request
  • 39. GitHub Ninja Features Markdown for documentation Pages for project hosting Gist for project hosting Service Hooks ‘do something’ on commit
  • 40. may the Force be with you

Editor's Notes

  • #2: we start off a project having a fair idea of what we are going to do ...
  • #3: soon we have multiple iterations, multiple versions...
  • #4: and then we have to collaborate, share...
  • #11: (almost) everything is local... branching, merging etc
  • #12: (almost) everything is local... branching, merging etc
  • #13: initially created by Linus Torvalds, now supported by a huge open source community ... field tested with Linux Kernel
  • #14: You don’t have to go ask someone to create a branch for you, or create a repo for you or request a branch merge.. you do as you please with YOUR copy.
  • #15: We’ll be using the git command line interface, but feel free to choose your preferred solution GUIs, Editor Extension etc
  • #23: Although, I like working in small steps, here are some shortcuts git commit -m “<your msg>” [doesn’t open up the editor for msg] git commit -am “<your msg>” [adds the files tracked and uses msg on command-line]
  • #36: now do a demo of jim workflow
  • #37: now show them a demo of creating ssh key on my ischool account
  • #39: show the students
  • #40: show the students