+ All Categories
Home > Documents > Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control...

Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control...

Date post: 03-Aug-2020
Category:
Upload: others
View: 8 times
Download: 0 times
Share this document with a friend
113
Version control system: git Madhu Belur Control & Computing group, Electrical Engineering Dept, IIT Bombay FOSSEE project, IIT Bombay This talk (updated/corrected) at: http://www.ee.iitb.ac.in/%7Ebelur/talks/ Dec 2017: Induction Training Programme Belur/FOSSEE/Git Git version control 1/27
Transcript
Page 1: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control system: git

Madhu Belur

Control & Computing group,Electrical Engineering Dept, IIT Bombay

FOSSEE project, IIT BombayThis talk (updated/corrected) at:

http://www.ee.iitb.ac.in/%7Ebelur/talks/

Dec 2017: Induction Training Programme

Belur/FOSSEE/Git Git version control 1/27

Page 2: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Outline

Version control

Dropbox/Git/Google-Drive (GDrive)

Advantages/disadvantages of above 3 examples

Git commands

Spoken tutorials

Belur/FOSSEE/Git Git version control 2/27

Page 3: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control

Why version control?

hard-disk crash! (actually very rare, these days)

delete file by mistake

overwrite by mistake

add/edit from the wrong past version

difficulty remembering which is the latest

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Belur/FOSSEE/Git Git version control 3/27

Page 4: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control

Why version control?

hard-disk crash! (actually very rare, these days)

delete file by mistake

overwrite by mistake

add/edit from the wrong past version

difficulty remembering which is the latest

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Belur/FOSSEE/Git Git version control 3/27

Page 5: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control

Why version control?

hard-disk crash! (actually very rare, these days)

delete file by mistake

overwrite by mistake

add/edit from the wrong past version

difficulty remembering which is the latest

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Belur/FOSSEE/Git Git version control 3/27

Page 6: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control

Why version control?

hard-disk crash! (actually very rare, these days)

delete file by mistake

overwrite by mistake

add/edit from the wrong past version

difficulty remembering which is the latest

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Belur/FOSSEE/Git Git version control 3/27

Page 7: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control

Why version control?

hard-disk crash! (actually very rare, these days)

delete file by mistake

overwrite by mistake

add/edit from the wrong past version

difficulty remembering which is the latest

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Belur/FOSSEE/Git Git version control 3/27

Page 8: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control

Why version control?

hard-disk crash! (actually very rare, these days)

delete file by mistake

overwrite by mistake

add/edit from the wrong past version

difficulty remembering which is the latest

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Belur/FOSSEE/Git Git version control 3/27

Page 9: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control

Why version control?

hard-disk crash! (actually very rare, these days)

delete file by mistake

overwrite by mistake

add/edit from the wrong past version

difficulty remembering which is the latest

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Belur/FOSSEE/Git Git version control 3/27

Page 10: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control

Why version control?

hard-disk crash! (actually very rare, these days)

delete file by mistake

overwrite by mistake

add/edit from the wrong past version

difficulty remembering which is the latest

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Belur/FOSSEE/Git Git version control 3/27

Page 11: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control

Why version control?

hard-disk crash! (actually very rare, these days)

delete file by mistake

overwrite by mistake

add/edit from the wrong past version

difficulty remembering which is the latest

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Belur/FOSSEE/Git Git version control 3/27

Page 12: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control

Why version control?

hard-disk crash! (actually very rare, these days)

delete file by mistake

overwrite by mistake

add/edit from the wrong past version

difficulty remembering which is the latest

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Belur/FOSSEE/Git Git version control 3/27

Page 13: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control

Why version control?

hard-disk crash! (actually very rare, these days)

delete file by mistake

overwrite by mistake

add/edit from the wrong past version

difficulty remembering which is the latest

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Belur/FOSSEE/Git Git version control 3/27

Page 14: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Why version control: contd

Collaboration/sharing

Need for systematic file-naming (if multiple versions)

Need to revert back to a particular version (line-number,etc.)

Call past versions with short and long descriptions

extract differences about what changes weredone/resolved

Belur/FOSSEE/Git Git version control 4/27

Page 15: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Why version control: contd

Collaboration/sharing

Need for systematic file-naming (if multiple versions)

Need to revert back to a particular version (line-number,etc.)

Call past versions with short and long descriptions

extract differences about what changes weredone/resolved

Belur/FOSSEE/Git Git version control 4/27

Page 16: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Why version control: contd

Collaboration/sharing

Need for systematic file-naming (if multiple versions)

Need to revert back to a particular version (line-number,etc.)

Call past versions with short and long descriptions

extract differences about what changes weredone/resolved

Belur/FOSSEE/Git Git version control 4/27

Page 17: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Why version control: contd

Collaboration/sharing

Need for systematic file-naming (if multiple versions)

Need to revert back to a particular version (line-number,etc.)

Call past versions with short and long descriptions

extract differences about what changes weredone/resolved

Belur/FOSSEE/Git Git version control 4/27

Page 18: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Why version control: contd

Collaboration/sharing

Need for systematic file-naming (if multiple versions)

Need to revert back to a particular version (line-number,etc.)

Call past versions with short and long descriptions

extract differences about what changes weredone/resolved

Belur/FOSSEE/Git Git version control 4/27

Page 19: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git

Edit locally (using any plain text editor:Notepad/Emacs/Vim/Gedit/Pico/Nano). Your favoriteIDE: for Python, Latex, C, C++)

Available for GNU-Linux/Windows/Mac

Easy to install

Very useful for both local and online version control

Github: just an online repository: uses git commands

Bitbucket: also an online repository: uses git commands

Also, SVN and Mercurial (≡ hg) are good version controlsystems.

Belur/FOSSEE/Git Git version control 5/27

Page 20: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git

Edit locally (using any plain text editor:Notepad/Emacs/Vim/Gedit/Pico/Nano). Your favoriteIDE: for Python, Latex, C, C++)

Available for GNU-Linux/Windows/Mac

Easy to install

Very useful for both local and online version control

Github: just an online repository: uses git commands

Bitbucket: also an online repository: uses git commands

Also, SVN and Mercurial (≡ hg) are good version controlsystems.

Belur/FOSSEE/Git Git version control 5/27

Page 21: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git

Edit locally (using any plain text editor:Notepad/Emacs/Vim/Gedit/Pico/Nano). Your favoriteIDE: for Python, Latex, C, C++)

Available for GNU-Linux/Windows/Mac

Easy to install

Very useful for both local and online version control

Github: just an online repository: uses git commands

Bitbucket: also an online repository: uses git commands

Also, SVN and Mercurial (≡ hg) are good version controlsystems.

Belur/FOSSEE/Git Git version control 5/27

Page 22: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git

Edit locally (using any plain text editor:Notepad/Emacs/Vim/Gedit/Pico/Nano). Your favoriteIDE: for Python, Latex, C, C++)

Available for GNU-Linux/Windows/Mac

Easy to install

Very useful for both local and online version control

Github: just an online repository: uses git commands

Bitbucket: also an online repository: uses git commands

Also, SVN and Mercurial (≡ hg) are good version controlsystems.

Belur/FOSSEE/Git Git version control 5/27

Page 23: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git

Edit locally (using any plain text editor:Notepad/Emacs/Vim/Gedit/Pico/Nano). Your favoriteIDE: for Python, Latex, C, C++)

Available for GNU-Linux/Windows/Mac

Easy to install

Very useful for both local and online version control

Github: just an online repository: uses git commands

Bitbucket: also an online repository: uses git commands

Also, SVN and Mercurial (≡ hg) are good version controlsystems.

Belur/FOSSEE/Git Git version control 5/27

Page 24: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git

Edit locally (using any plain text editor:Notepad/Emacs/Vim/Gedit/Pico/Nano). Your favoriteIDE: for Python, Latex, C, C++)

Available for GNU-Linux/Windows/Mac

Easy to install

Very useful for both local and online version control

Github: just an online repository: uses git commands

Bitbucket: also an online repository: uses git commands

Also, SVN and Mercurial (≡ hg) are good version controlsystems.

Belur/FOSSEE/Git Git version control 5/27

Page 25: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git

Edit locally (using any plain text editor:Notepad/Emacs/Vim/Gedit/Pico/Nano). Your favoriteIDE: for Python, Latex, C, C++)

Available for GNU-Linux/Windows/Mac

Easy to install

Very useful for both local and online version control

Github: just an online repository: uses git commands

Bitbucket: also an online repository: uses git commands

Also, SVN and Mercurial (≡ hg) are good version controlsystems.

Belur/FOSSEE/Git Git version control 5/27

Page 26: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Dropbox

Can edit locally

Need not be plain text

Can retrieve from internet

Auto-syncing (when internet is on)

Shows conflicts if somebody else updated before we‘pushed’ changes

Belur/FOSSEE/Git Git version control 6/27

Page 27: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Dropbox

Can edit locally

Need not be plain text

Can retrieve from internet

Auto-syncing (when internet is on)

Shows conflicts if somebody else updated before we‘pushed’ changes

Belur/FOSSEE/Git Git version control 6/27

Page 28: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Dropbox

Can edit locally

Need not be plain text

Can retrieve from internet

Auto-syncing (when internet is on)

Shows conflicts if somebody else updated before we‘pushed’ changes

Belur/FOSSEE/Git Git version control 6/27

Page 29: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Dropbox

Can edit locally

Need not be plain text

Can retrieve from internet

Auto-syncing (when internet is on)

Shows conflicts if somebody else updated before we‘pushed’ changes

Belur/FOSSEE/Git Git version control 6/27

Page 30: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Dropbox

Can edit locally

Need not be plain text

Can retrieve from internet

Auto-syncing (when internet is on)

Shows conflicts if somebody else updated before we‘pushed’ changes

Belur/FOSSEE/Git Git version control 6/27

Page 31: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Google-drive

Need internet to edit/access

Need Gmail account

Not good for confidential information

Can edit directly on the drive (doc/spreadsheet/ppt)

Can see the collaborator’s cursor

Automatically no ‘conflicts’

Each small edit is a separate version: too many versions

Belur/FOSSEE/Git Git version control 7/27

Page 32: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Google-drive

Need internet to edit/access

Need Gmail account

Not good for confidential information

Can edit directly on the drive (doc/spreadsheet/ppt)

Can see the collaborator’s cursor

Automatically no ‘conflicts’

Each small edit is a separate version: too many versions

Belur/FOSSEE/Git Git version control 7/27

Page 33: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Google-drive

Need internet to edit/access

Need Gmail account

Not good for confidential information

Can edit directly on the drive (doc/spreadsheet/ppt)

Can see the collaborator’s cursor

Automatically no ‘conflicts’

Each small edit is a separate version: too many versions

Belur/FOSSEE/Git Git version control 7/27

Page 34: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Google-drive

Need internet to edit/access

Need Gmail account

Not good for confidential information

Can edit directly on the drive (doc/spreadsheet/ppt)

Can see the collaborator’s cursor

Automatically no ‘conflicts’

Each small edit is a separate version: too many versions

Belur/FOSSEE/Git Git version control 7/27

Page 35: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Google-drive

Need internet to edit/access

Need Gmail account

Not good for confidential information

Can edit directly on the drive (doc/spreadsheet/ppt)

Can see the collaborator’s cursor

Automatically no ‘conflicts’

Each small edit is a separate version: too many versions

Belur/FOSSEE/Git Git version control 7/27

Page 36: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Google-drive

Need internet to edit/access

Need Gmail account

Not good for confidential information

Can edit directly on the drive (doc/spreadsheet/ppt)

Can see the collaborator’s cursor

Automatically no ‘conflicts’

Each small edit is a separate version: too many versions

Belur/FOSSEE/Git Git version control 7/27

Page 37: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Summary and broad purposes

Git: for simple to very complex coding: advancedfeatures for this

Dropbox: for any type of file: automatic syncing

GDrive: no local editing. Only directly on Internet

Belur/FOSSEE/Git Git version control 8/27

Page 38: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Summary and broad purposes

Git: for simple to very complex coding: advancedfeatures for this

Dropbox: for any type of file: automatic syncing

GDrive: no local editing. Only directly on Internet

Belur/FOSSEE/Git Git version control 8/27

Page 39: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Summary and broad purposes

Git: for simple to very complex coding: advancedfeatures for this

Dropbox: for any type of file: automatic syncing

GDrive: no local editing. Only directly on Internet

Belur/FOSSEE/Git Git version control 8/27

Page 40: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Some comparisons

Favorite editor: sayemacs/vim/gedit/notepad/wordpad/nano

Git: any editor

Dropbox: any editor

GDrive: (at least default): forced to use very-basiceditor

Belur/FOSSEE/Git Git version control 9/27

Page 41: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Some comparisons

Favorite editor: sayemacs/vim/gedit/notepad/wordpad/nano

Git: any editor

Dropbox: any editor

GDrive: (at least default): forced to use very-basiceditor

Belur/FOSSEE/Git Git version control 9/27

Page 42: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Some comparisons

Favorite editor: sayemacs/vim/gedit/notepad/wordpad/nano

Git: any editor

Dropbox: any editor

GDrive: (at least default): forced to use very-basiceditor

Belur/FOSSEE/Git Git version control 9/27

Page 43: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Some comparisons

Favorite editor: sayemacs/vim/gedit/notepad/wordpad/nano

Git: any editor

Dropbox: any editor

GDrive: (at least default): forced to use very-basiceditor

Belur/FOSSEE/Git Git version control 9/27

Page 44: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Some comparisons

Favorite editor: sayemacs/vim/gedit/notepad/wordpad/nano

Git: any editor

Dropbox: any editor

GDrive: (at least default): forced to use very-basiceditor

Belur/FOSSEE/Git Git version control 9/27

Page 45: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Conflict resolution (collaboration)

Git: shows pin-pointed differences, and shortcuts forresolving

Dropbox: reasonably (I believe)

GDrive: shows with colour about changes

Belur/FOSSEE/Git Git version control 10/27

Page 46: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Conflict resolution (collaboration)

Git: shows pin-pointed differences, and shortcuts forresolving

Dropbox: reasonably (I believe)

GDrive: shows with colour about changes

Belur/FOSSEE/Git Git version control 10/27

Page 47: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Conflict resolution (collaboration)

Git: shows pin-pointed differences, and shortcuts forresolving

Dropbox: reasonably (I believe)

GDrive: shows with colour about changes

Belur/FOSSEE/Git Git version control 10/27

Page 48: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Conflict resolution (collaboration)

Git: shows pin-pointed differences, and shortcuts forresolving

Dropbox: reasonably (I believe)

GDrive: shows with colour about changes

Belur/FOSSEE/Git Git version control 10/27

Page 49: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Automatic syncing

Git: manual syncing: recommended for complex code(with shortcuts)Ensure no bugs before ‘committing’ changes or lettingothers see

Others (Dropbox/GDrive) automatic: and can beirritating or advantageous

Each local small change keeps syncing: bad for latex andcollaborators, etc.

GDrive: nothing local anyway

Belur/FOSSEE/Git Git version control 11/27

Page 50: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Automatic syncing

Git: manual syncing: recommended for complex code(with shortcuts)Ensure no bugs before ‘committing’ changes or lettingothers see

Others (Dropbox/GDrive) automatic: and can beirritating or advantageous

Each local small change keeps syncing: bad for latex andcollaborators, etc.

GDrive: nothing local anyway

Belur/FOSSEE/Git Git version control 11/27

Page 51: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Automatic syncing

Git: manual syncing: recommended for complex code(with shortcuts)Ensure no bugs before ‘committing’ changes or lettingothers see

Others (Dropbox/GDrive) automatic: and can beirritating or advantageous

Each local small change keeps syncing: bad for latex andcollaborators, etc.

GDrive: nothing local anyway

Belur/FOSSEE/Git Git version control 11/27

Page 52: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Automatic syncing

Git: manual syncing: recommended for complex code(with shortcuts)Ensure no bugs before ‘committing’ changes or lettingothers see

Others (Dropbox/GDrive) automatic: and can beirritating or advantageous

Each local small change keeps syncing: bad for latex andcollaborators, etc.

GDrive: nothing local anyway

Belur/FOSSEE/Git Git version control 11/27

Page 53: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Automatic syncing

Git: manual syncing: recommended for complex code(with shortcuts)Ensure no bugs before ‘committing’ changes or lettingothers see

Others (Dropbox/GDrive) automatic: and can beirritating or advantageous

Each local small change keeps syncing: bad for latex andcollaborators, etc.

GDrive: nothing local anyway

Belur/FOSSEE/Git Git version control 11/27

Page 54: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Automatic syncing

Git: manual syncing: recommended for complex code(with shortcuts)Ensure no bugs before ‘committing’ changes or lettingothers see

Others (Dropbox/GDrive) automatic: and can beirritating or advantageous

Each local small change keeps syncing: bad for latex andcollaborators, etc.

GDrive: nothing local anyway

Belur/FOSSEE/Git Git version control 11/27

Page 55: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Online repository

GDrive: only online repository

Local repo possible for Dropbox and Git

Online repository: relevant for sharing or multiple PCsfor oneself

Belur/FOSSEE/Git Git version control 12/27

Page 56: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Online repository

GDrive: only online repository

Local repo possible for Dropbox and Git

Online repository: relevant for sharing or multiple PCsfor oneself

Belur/FOSSEE/Git Git version control 12/27

Page 57: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Online repository

GDrive: only online repository

Local repo possible for Dropbox and Git

Online repository: relevant for sharing or multiple PCsfor oneself

Belur/FOSSEE/Git Git version control 12/27

Page 58: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Online repository

GDrive: only online repository

Local repo possible for Dropbox and Git

Online repository: relevant for sharing or multiple PCsfor oneself

Belur/FOSSEE/Git Git version control 12/27

Page 59: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Branching

Relevant for code: when packages provide support formultiple versions

Git: targets such purposes: internationally used byindividuals and companies

Dropbox/GDrive: need to just make copies. No‘merging’

Belur/FOSSEE/Git Git version control 13/27

Page 60: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Branching

Relevant for code: when packages provide support formultiple versions

Git: targets such purposes: internationally used byindividuals and companies

Dropbox/GDrive: need to just make copies. No‘merging’

Belur/FOSSEE/Git Git version control 13/27

Page 61: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Branching

Relevant for code: when packages provide support formultiple versions

Git: targets such purposes: internationally used byindividuals and companies

Dropbox/GDrive: need to just make copies. No‘merging’

Belur/FOSSEE/Git Git version control 13/27

Page 62: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Branching

Relevant for code: when packages provide support formultiple versions

Git: targets such purposes: internationally used byindividuals and companies

Dropbox/GDrive: need to just make copies. No‘merging’

Belur/FOSSEE/Git Git version control 13/27

Page 63: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Sharing

Github and bitbucket: some free/paid privaterepositories

Public repositories (meaning anybody can VIEW, butedit-access for few only.)

Dropbox/GDrive: can share to specificemail-addresses/accounts (any number)

GDrive allows: view/edit: but also ‘commenting’(intermediate level access)

Belur/FOSSEE/Git Git version control 14/27

Page 64: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Sharing

Github and bitbucket: some free/paid privaterepositories

Public repositories (meaning anybody can VIEW, butedit-access for few only.)

Dropbox/GDrive: can share to specificemail-addresses/accounts (any number)

GDrive allows: view/edit: but also ‘commenting’(intermediate level access)

Belur/FOSSEE/Git Git version control 14/27

Page 65: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Sharing

Github and bitbucket: some free/paid privaterepositories

Public repositories (meaning anybody can VIEW, butedit-access for few only.)

Dropbox/GDrive: can share to specificemail-addresses/accounts (any number)

GDrive allows: view/edit: but also ‘commenting’(intermediate level access)

Belur/FOSSEE/Git Git version control 14/27

Page 66: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Sharing

Github and bitbucket: some free/paid privaterepositories

Public repositories (meaning anybody can VIEW, butedit-access for few only.)

Dropbox/GDrive: can share to specificemail-addresses/accounts (any number)

GDrive allows: view/edit: but also ‘commenting’(intermediate level access)

Belur/FOSSEE/Git Git version control 14/27

Page 67: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Sharing

Github and bitbucket: some free/paid privaterepositories

Public repositories (meaning anybody can VIEW, butedit-access for few only.)

Dropbox/GDrive: can share to specificemail-addresses/accounts (any number)

GDrive allows: view/edit: but also ‘commenting’(intermediate level access)

Belur/FOSSEE/Git Git version control 14/27

Page 68: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git and Github

Why Git?

Very relevant for code

Internationally the norm: only ‘laymen’ shy away fromgit/github

Advanced features: fork (edit independently andperhaps merge)

Ask owner for ‘pull request’ to merge our fork back

For alpha/beta versions of new packages

Github shows full code history: allows automatic testing(nose-tests, test driven development)

Belur/FOSSEE/Git Git version control 15/27

Page 69: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git and Github

Why Git?

Very relevant for code

Internationally the norm: only ‘laymen’ shy away fromgit/github

Advanced features: fork (edit independently andperhaps merge)

Ask owner for ‘pull request’ to merge our fork back

For alpha/beta versions of new packages

Github shows full code history: allows automatic testing(nose-tests, test driven development)

Belur/FOSSEE/Git Git version control 15/27

Page 70: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git and Github

Why Git?

Very relevant for code

Internationally the norm: only ‘laymen’ shy away fromgit/github

Advanced features: fork (edit independently andperhaps merge)

Ask owner for ‘pull request’ to merge our fork back

For alpha/beta versions of new packages

Github shows full code history: allows automatic testing(nose-tests, test driven development)

Belur/FOSSEE/Git Git version control 15/27

Page 71: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git and Github

Why Git?

Very relevant for code

Internationally the norm: only ‘laymen’ shy away fromgit/github

Advanced features: fork (edit independently andperhaps merge)

Ask owner for ‘pull request’ to merge our fork back

For alpha/beta versions of new packages

Github shows full code history: allows automatic testing(nose-tests, test driven development)

Belur/FOSSEE/Git Git version control 15/27

Page 72: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git and Github

Why Git?

Very relevant for code

Internationally the norm: only ‘laymen’ shy away fromgit/github

Advanced features: fork (edit independently andperhaps merge)

Ask owner for ‘pull request’ to merge our fork back

For alpha/beta versions of new packages

Github shows full code history: allows automatic testing(nose-tests, test driven development)

Belur/FOSSEE/Git Git version control 15/27

Page 73: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git and Github

Why Git?

Very relevant for code

Internationally the norm: only ‘laymen’ shy away fromgit/github

Advanced features: fork (edit independently andperhaps merge)

Ask owner for ‘pull request’ to merge our fork back

For alpha/beta versions of new packages

Github shows full code history: allows automatic testing(nose-tests, test driven development)

Belur/FOSSEE/Git Git version control 15/27

Page 74: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git and Github

Why Git?

Very relevant for code

Internationally the norm: only ‘laymen’ shy away fromgit/github

Advanced features: fork (edit independently andperhaps merge)

Ask owner for ‘pull request’ to merge our fork back

For alpha/beta versions of new packages

Github shows full code history: allows automatic testing(nose-tests, test driven development)

Belur/FOSSEE/Git Git version control 15/27

Page 75: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git and Github

Why Git?

Very relevant for code

Internationally the norm: only ‘laymen’ shy away fromgit/github

Advanced features: fork (edit independently andperhaps merge)

Ask owner for ‘pull request’ to merge our fork back

For alpha/beta versions of new packages

Github shows full code history: allows automatic testing(nose-tests, test driven development)

Belur/FOSSEE/Git Git version control 15/27

Page 76: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Installation: for MS Windows

Google for git MS-windows setup file

Open MS command prompt and make a suitabledirectory for testing purposes

md and cd are MD-DOS commands for making adirectory and changing into that directory

Belur/FOSSEE/Git Git version control 16/27

Page 77: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Installation: for Ubuntu GNU-Linux

sudo apt-get install git

Belur/FOSSEE/Git Git version control 17/27

Page 78: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git commands

git config --global user.name "Madhu Belur"

git config --global user.email [email protected]

(without ‘–global’ flag: only for that directory)

git init

git add filename

Belur/FOSSEE/Git Git version control 18/27

Page 79: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git commands

git config --global user.name "Madhu Belur"

git config --global user.email [email protected]

(without ‘–global’ flag: only for that directory)

git init

git add filename

Belur/FOSSEE/Git Git version control 18/27

Page 80: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Git commands

git config --global user.name "Madhu Belur"

git config --global user.email [email protected]

(without ‘–global’ flag: only for that directory)

git init

git add filename

Belur/FOSSEE/Git Git version control 18/27

Page 81: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Make changes and then commit

git commit

git diff

git revert # to the version you want

In bash, # means everything after # is ‘comment’ (onthat line: ignore)

Many spoken-tutorials available athttp://spoken-tutorial.org

Belur/FOSSEE/Git Git version control 19/27

Page 82: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Make changes and then commit

git commit

git diff

git revert # to the version you want

In bash, # means everything after # is ‘comment’ (onthat line: ignore)

Many spoken-tutorials available athttp://spoken-tutorial.org

Belur/FOSSEE/Git Git version control 19/27

Page 83: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Make changes and then commit

git commit

git diff

git revert # to the version you want

In bash, # means everything after # is ‘comment’ (onthat line: ignore)

Many spoken-tutorials available athttp://spoken-tutorial.org

Belur/FOSSEE/Git Git version control 19/27

Page 84: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Make changes and then commit

git commit

git diff

git revert # to the version you want

In bash, # means everything after # is ‘comment’ (onthat line: ignore)

Many spoken-tutorials available athttp://spoken-tutorial.org

Belur/FOSSEE/Git Git version control 19/27

Page 85: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Editor changing (during committing)

How to change editor

git config --global core.editor notepad # (for MSWindows)

git config --global core.editor nano # (for linux, etc)

git config --global core.editor emacs # (for linux, etc)

https://help.github.com/articles/associating-text-editors-with-git

https://help.github.com/articles/associating-text-editors-with-

git/#platform-windows

Belur/FOSSEE/Git Git version control 20/27

Page 86: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

How to delete a file

First delete the file the regular way

Tell git you are no longer interested in the file bygit rm filename

git commit # tell as comment that you deleted the file(intentionally)

Belur/FOSSEE/Git Git version control 21/27

Page 87: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

How to retrieve deleted file

If file was never committed to git, then git cannot help:-)

If file was committed at least once, and then we retrievethe deleted (and commited) file by:git checkout HEADˆ filename

This will retrieve the version just before deleting

Need to commit again (to tell git about the latestversion: post un-deleting the file)

Can retrieve previously committed versions also (usingrevert)

https://stackoverflow.com/questions/953481/find-and-

restore-a-deleted-file-in-a-git-repository

Belur/FOSSEE/Git Git version control 22/27

Page 88: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

How to revert

Need to understand small but complex differencebetween

staging areacheckoutHEADMASTER Branch

HEAD means current (latest committed)

HEAD 1 means just previously committed one (HEADminus 1)

git log file or git log

gives log (with your descriptions)

Belur/FOSSEE/Git Git version control 23/27

Page 89: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

How to see differences

git diff filename

shows difference between just-previously committed oneand latest

Belur/FOSSEE/Git Git version control 24/27

Page 90: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Github for collaboration

git clone # optional (for taking previous repo)

git add

change, commit, ‘push’ # push also optional

Or request for pulling our changes

pull-request: the owner pulls our changes, so we requesthim/her to pull our changes

git from browser allows interactive displays: shows conflictswith syntax highlighting

Belur/FOSSEE/Git Git version control 25/27

Page 91: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Github for collaboration

git clone # optional (for taking previous repo)

git add

change, commit, ‘push’ # push also optional

Or request for pulling our changes

pull-request: the owner pulls our changes, so we requesthim/her to pull our changes

git from browser allows interactive displays: shows conflictswith syntax highlighting

Belur/FOSSEE/Git Git version control 25/27

Page 92: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Github for collaboration

git clone # optional (for taking previous repo)

git add

change, commit, ‘push’ # push also optional

Or request for pulling our changes

pull-request: the owner pulls our changes, so we requesthim/her to pull our changes

git from browser allows interactive displays: shows conflictswith syntax highlighting

Belur/FOSSEE/Git Git version control 25/27

Page 93: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Github for collaboration

git clone # optional (for taking previous repo)

git add

change, commit, ‘push’ # push also optional

Or request for pulling our changes

pull-request: the owner pulls our changes, so we requesthim/her to pull our changes

git from browser allows interactive displays: shows conflictswith syntax highlighting

Belur/FOSSEE/Git Git version control 25/27

Page 94: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Github for collaboration

git clone # optional (for taking previous repo)

git add

change, commit, ‘push’ # push also optional

Or request for pulling our changes

pull-request: the owner pulls our changes, so we requesthim/her to pull our changes

git from browser allows interactive displays: shows conflictswith syntax highlighting

Belur/FOSSEE/Git Git version control 25/27

Page 95: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Github for collaboration

git clone # optional (for taking previous repo)

git add

change, commit, ‘push’ # push also optional

Or request for pulling our changes

pull-request: the owner pulls our changes, so we requesthim/her to pull our changes

git from browser allows interactive displays: shows conflictswith syntax highlighting

Belur/FOSSEE/Git Git version control 25/27

Page 96: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Github for collaboration

git clone # optional (for taking previous repo)

git add

change, commit, ‘push’ # push also optional

Or request for pulling our changes

pull-request: the owner pulls our changes, so we requesthim/her to pull our changes

git from browser allows interactive displays: shows conflictswith syntax highlighting

Belur/FOSSEE/Git Git version control 25/27

Page 97: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Github for collaboration

git clone # optional (for taking previous repo)

git add

change, commit, ‘push’ # push also optional

Or request for pulling our changes

pull-request: the owner pulls our changes, so we requesthim/her to pull our changes

git from browser allows interactive displays: shows conflictswith syntax highlighting

Belur/FOSSEE/Git Git version control 25/27

Page 98: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control as a habit

Learn to keep past versions ‘systematically’

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Relevant for retrieving: recommended forlocal/individual usage also

Belur/FOSSEE/Git Git version control 26/27

Page 99: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control as a habit

Learn to keep past versions ‘systematically’

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Relevant for retrieving: recommended forlocal/individual usage also

Belur/FOSSEE/Git Git version control 26/27

Page 100: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control as a habit

Learn to keep past versions ‘systematically’

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Relevant for retrieving: recommended forlocal/individual usage also

Belur/FOSSEE/Git Git version control 26/27

Page 101: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control as a habit

Learn to keep past versions ‘systematically’

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Relevant for retrieving: recommended forlocal/individual usage also

Belur/FOSSEE/Git Git version control 26/27

Page 102: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control as a habit

Learn to keep past versions ‘systematically’

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Relevant for retrieving: recommended forlocal/individual usage also

Belur/FOSSEE/Git Git version control 26/27

Page 103: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control as a habit

Learn to keep past versions ‘systematically’

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Relevant for retrieving: recommended forlocal/individual usage also

Belur/FOSSEE/Git Git version control 26/27

Page 104: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Version control as a habit

Learn to keep past versions ‘systematically’

final.doc, final1.doc, finalest.doc, most-final.doc,final8thDec.doc,final8thDec.doc (but last-edited on 13thDec)final8thDecWithAdditions.doc

Relevant for retrieving: recommended forlocal/individual usage also

Belur/FOSSEE/Git Git version control 26/27

Page 105: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Overhead

Tell git explicitly to maintain only ‘source’ (and not‘generated’ files)

Extra past source-files saved: extra disk-usage: overhead

Negligible overhead (of saving past versions)

Can quickly search through comments of past versions

Internet bandwidth: always will be inadequate: videocalls, HD-movies

Safer/wiser to be independent of Internet

Latest version of this ppt at:

http://www.ee.iitb.ac.in/%7Ebelur/talks/

Thank you

Belur/FOSSEE/Git Git version control 27/27

Page 106: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Overhead

Tell git explicitly to maintain only ‘source’ (and not‘generated’ files)

Extra past source-files saved: extra disk-usage: overhead

Negligible overhead (of saving past versions)

Can quickly search through comments of past versions

Internet bandwidth: always will be inadequate: videocalls, HD-movies

Safer/wiser to be independent of Internet

Latest version of this ppt at:

http://www.ee.iitb.ac.in/%7Ebelur/talks/

Thank you

Belur/FOSSEE/Git Git version control 27/27

Page 107: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Overhead

Tell git explicitly to maintain only ‘source’ (and not‘generated’ files)

Extra past source-files saved: extra disk-usage: overhead

Negligible overhead (of saving past versions)

Can quickly search through comments of past versions

Internet bandwidth: always will be inadequate: videocalls, HD-movies

Safer/wiser to be independent of Internet

Latest version of this ppt at:

http://www.ee.iitb.ac.in/%7Ebelur/talks/

Thank you

Belur/FOSSEE/Git Git version control 27/27

Page 108: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Overhead

Tell git explicitly to maintain only ‘source’ (and not‘generated’ files)

Extra past source-files saved: extra disk-usage: overhead

Negligible overhead (of saving past versions)

Can quickly search through comments of past versions

Internet bandwidth: always will be inadequate: videocalls, HD-movies

Safer/wiser to be independent of Internet

Latest version of this ppt at:

http://www.ee.iitb.ac.in/%7Ebelur/talks/

Thank you

Belur/FOSSEE/Git Git version control 27/27

Page 109: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Overhead

Tell git explicitly to maintain only ‘source’ (and not‘generated’ files)

Extra past source-files saved: extra disk-usage: overhead

Negligible overhead (of saving past versions)

Can quickly search through comments of past versions

Internet bandwidth: always will be inadequate: videocalls, HD-movies

Safer/wiser to be independent of Internet

Latest version of this ppt at:

http://www.ee.iitb.ac.in/%7Ebelur/talks/

Thank you

Belur/FOSSEE/Git Git version control 27/27

Page 110: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Overhead

Tell git explicitly to maintain only ‘source’ (and not‘generated’ files)

Extra past source-files saved: extra disk-usage: overhead

Negligible overhead (of saving past versions)

Can quickly search through comments of past versions

Internet bandwidth: always will be inadequate: videocalls, HD-movies

Safer/wiser to be independent of Internet

Latest version of this ppt at:

http://www.ee.iitb.ac.in/%7Ebelur/talks/

Thank you

Belur/FOSSEE/Git Git version control 27/27

Page 111: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Overhead

Tell git explicitly to maintain only ‘source’ (and not‘generated’ files)

Extra past source-files saved: extra disk-usage: overhead

Negligible overhead (of saving past versions)

Can quickly search through comments of past versions

Internet bandwidth: always will be inadequate: videocalls, HD-movies

Safer/wiser to be independent of Internet

Latest version of this ppt at:

http://www.ee.iitb.ac.in/%7Ebelur/talks/

Thank you

Belur/FOSSEE/Git Git version control 27/27

Page 112: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Overhead

Tell git explicitly to maintain only ‘source’ (and not‘generated’ files)

Extra past source-files saved: extra disk-usage: overhead

Negligible overhead (of saving past versions)

Can quickly search through comments of past versions

Internet bandwidth: always will be inadequate: videocalls, HD-movies

Safer/wiser to be independent of Internet

Latest version of this ppt at:

http://www.ee.iitb.ac.in/%7Ebelur/talks/

Thank you

Belur/FOSSEE/Git Git version control 27/27

Page 113: Version control system: gitbelur/talks/pdfs/pm3nmt2-git.pdf · Belur/FOSSEE/Git Git version control 3/27. Version control Why version control? hard-disk crash! (actually veryrare,these

Overhead

Tell git explicitly to maintain only ‘source’ (and not‘generated’ files)

Extra past source-files saved: extra disk-usage: overhead

Negligible overhead (of saving past versions)

Can quickly search through comments of past versions

Internet bandwidth: always will be inadequate: videocalls, HD-movies

Safer/wiser to be independent of Internet

Latest version of this ppt at:

http://www.ee.iitb.ac.in/%7Ebelur/talks/

Thank you

Belur/FOSSEE/Git Git version control 27/27


Recommended