Basics of Git and Version Control

20
http://j.mp/gitsylhet

Transcript of Basics of Git and Version Control

Page 1: Basics of Git and Version Control

http://j.mp/gitsylhet

Page 2: Basics of Git and Version Control

http://usman.it

Page 3: Basics of Git and Version Control

http://VeganCuts.com

Page 4: Basics of Git and Version Control

http://CreateAudience.com

Page 5: Basics of Git and Version Control

http://GitHub.com/usmanhalalit

Page 6: Basics of Git and Version Control

GitisaVersionControlandSourceCodeManagementSystem(VCSandSCM).

Page 7: Basics of Git and Version Control
Page 8: Basics of Git and Version Control

index.phpindex_old_old.phpindex_heera.phpindex_final.php

index_17_05_2012.phpindex_ajaira.php

index_mathhai_dhorai_felse.php

Page 9: Basics of Git and Version Control

http://GitHub.comhttp://BitBucket.com

Page 10: Basics of Git and Version Control

http://git-scm.com/downloads

GitHubforWindows/MacSourceTreeTower($)MoreDefaultCommandLineClient

http://git-scm.com/downloads/guis

Page 11: Basics of Git and Version Control
Page 12: Basics of Git and Version Control

GotoTerminalorMSDosPrompt:

Typeyourusernameandpasswordwhenprompted(forHTTPS)

gitclonehttps://github.com/usmanahalalit/php-workshop-sample.git

cdphp-workshop-sample

ls

LetspullagainelsewheresothatweIcandemonstratecollaboration.

Page 13: Basics of Git and Version Control

Addafiletouchindex.php

Makechangestoindex.php<?php

echo'WelcometoPHPWorkshop';

Checkstatusgitstatus

Addthefilegitaddindex.php

Commitchangesgitcommit-a

Pushchanges(needsinternet)gitpushoriginmaster

Page 14: Basics of Git and Version Control
Page 15: Basics of Git and Version Control

Okay,switchtoourHeeradirectorycd../php-workshop-sample-heera

Seewedon'thavechangesinHeeradirectoryPullchanges(needsinternet)

gitpulloriginmaster

Changefile<?php

echo'HelloHeera';

Commitchanges,wedon'tneedgitaddnowgitcommit-am"Changedwithmyname"

Pushchangesgitpushoriginmaster

Page 16: Basics of Git and Version Control
Page 17: Basics of Git and Version Control

Editcommitmessagegitcommit--amend

Branchinggitcheckoutdevelop-bgitcheckoutmastergitmergedevelop

.gitignoreapp/config/local*.tmp

GitConfig,GitReset,GitStash,GitRebase,CherryPick,........

Page 18: Basics of Git and Version Control
Page 19: Basics of Git and Version Control

Ihighlyrecommendchecking

Page 20: Basics of Git and Version Control

http://j.mp/gitsylhet