collaborative development using git, session conducted at model engineering college, ernakulam on...

21
No. 1 September 27, 2013 Collaborative development with Git Vimal Joseph Technical Architect

Upload: zyxware-technologies

Post on 29-Jan-2018

1.314 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 1September 27, 2013

Collaborative development with Git

Vimal Joseph

Technical Architect

Page 2: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 2September 27, 2013

Collaborative development with Git

Tracking Changes

User AUser B

D1

D1

Time

D1 D1.1 D1.2 D1.3

Page 3: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 3September 27, 2013

Collaborative development with Git

Tracking changes in a document with OpenOffice Writer

Page 4: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 4September 27, 2013

Collaborative development with Git

What about developing a software project?

Developer A Project Repository

S/w

Developer B

Page 5: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 5September 27, 2013

Collaborative development with Git

what about developing a software project?

Developer A ProjectRepository

S/w

User A User D

Developer B

Page 6: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 6September 27, 2013

Collaborative development with Git

How about developing a software project?

Developer A ProjectRepository

S/w

User A

User D

BUG

Developer B

Page 7: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 7September 27, 2013

Collaborative development with Git

what about developing a software project?

Developer A ProjectRepository

S/w

User A

User D

Developer B

Fixed Code(patch)

Page 8: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 8September 27, 2013

Collaborative development with Git

what about developing a software project?

Developer A Project Repository

S/w 1.1

User A

User DFixed Code(patch)

apply

Developer B

Page 9: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 9September 27, 2013

Collaborative development with Git

Softwares for Version Control

• Source Code Control System (SCCS)

• CVS

• Subversion (svn)

• Mercurial

• Bazaar

• Git

• Etc...

Page 10: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 10September 27, 2013

Collaborative development with Git

Git

• Developers : Junio Hamano and Linus Torvalds and several other people

• Website : http://git-scm.com/

• Linus Torvalds started its development on April 2005

• Distributed Version Control System

Page 11: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 11September 27, 2013

Collaborative development with Git

Distributed Version Control System

Page 12: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 12September 27, 2013

Collaborative development with Git

Let's Start the Git

• Introduce yourself to git

– git config –global user.name “Vimal Joseph”

– git config –global user.email “[email protected]

• Add some colour

– git config –global color.ui true

• Now your global configuration file is ready. You can check that at ~/.gitconfig

Page 13: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 13September 27, 2013

Collaborative development with Git

Git Repository

• Create a git repository

– mkdir your-directory-name\

– git init

• Add initial files to the git repository

– git add file1 file2

• Commit changes

– git commit

– (it will ask you to enter a comment)

• Log and status

– git log

– git status

• Help

– git help

Page 14: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 14September 27, 2013

Collaborative development with Git

Structure of Git

Page 15: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 15September 27, 2013

Collaborative development with Git

Head, Branches, Tags

Page 16: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 16September 27, 2013

Collaborative development with Git

Branching, Merging and tagging

• Create new branch and switch to it

– git branch name-of-branch

– git checkout name-of-branch

• Merge branches

– git merge name-of-branch-to-merge-with-current-branch

– Merge conflicts should be resolved manually

• Tagging

– git tag tag-name

– It will create a tag in the current git object pointed by the HEAD

Page 17: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 17September 27, 2013

Collaborative development with Git

Working with remote repositaries

• Add a remote repository

– git remote add origin url-of-remote-repository

• Push Pull

– git pull

– Pull the remote branch to the local branch

– git push origin master

– Push the change to the remote branch

Page 18: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 18September 27, 2013

Collaborative development with Git

Patching

• Branch

– git checkout -b fix_the_bug

• Create a patch

– git format-patch master --stdout > fix_the_bug.patch

• Applying the patch

– git apply --stat fix_empty_poster.patch

– git apply --check fix_empty_poster.patch

Page 19: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 19September 27, 2013

Collaborative development with Git

Working with remote repositaries

• Add a remote repository

– git remote add origin url-of-remote-repository

• Push Pull

– git pull

– Pull the remote branch to the local branch

– git push origin master

– Push the change to the remote branch

Page 20: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 20September 27, 2013

Collaborative development with Git

On-line git hosting

• http://gitorious.org/

• http://github.com

• Gitolite

Page 21: Collaborative development using git, Session conducted at Model Engineering College, Ernakulam on 2013-09-26

No. 21September 27, 2013

Collaborative development with Git

Thanks...

• http://git-scm.com/documentation

• questions??

[email protected] Technologies