Top Banner
SetucoCMS @akitsukada development work flow with Git
20
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: With git

SetucoCMS @akitsukada

developmentwork flow

with Git

Page 2: With git

case: Local work

Page 3: With git

1 of the three major affairs for modern software development!

Version Control

Test

Automation

VCS

Page 4: With git

Git is different from centerization VCS, e.g.SVN,CVS.

svn checkout repos git clone repos svn commit git commit && git push svn update git pull

Distributed

Page 5: With git

We have local repositories, so commit has no effect for others. John : svn commit (include BUGS!) Mike : svn update (with bugs, no notices)Git is very affable to chickens :) John : git commit (include BUGS) Mike : git pull (from safe repos) John : I fix bugs! :) John : git push

Safety for Repos

Page 6: With git

Each change has independent meaning, should be separated. John : edit a.txt b.txt c.txt d.txt ... John : svn commit (all files) Mike : edit a.txt b.txt c.txt d.txt ... Mike : git add a.txt Mike : git commit (only a.txt) Mike : git add b.txt c.txt ... Mike : git commit (b.txt, c.txt)

Nice small commit

Page 7: With git

Git can make more smaller commit. In 1 file’s changes. Mike : edit a.txt

Mike : git add -p ... demo ...

Git has wonderful flexibility for commits. Besides, we edit past commits freely too.

Very small commit

Page 8: With git

Git has 5 areas for tracking.- local - untrack -------------------------------------- track -------------------------------------- modified -------------------------------------- index --------------------------------------- remote - remote --------------------------------------Index is also called “Stage” or “Cache”.

Git repos world

Page 9: With git

SVN has no index.- local - untrack -------------------------------------- track -------------------------------------- modified --------------------------------------- remote - remote --------------------------------------

FYI, if SVN...

Page 10: With git

untrack ----------------------------------------

track ----------------------------------------

modified ----------------------------------------

index ----------------------------------------

remote ----------------------------------------

Flexibility by Index

add

editadd

pushcommit

reset

reset --hard

rm --cached

pull/clone

Page 11: With git

untrack ----------------------------------------

track ----------------------------------------

modified ----------------------------------------

remote ----------------------------------------

FYI, if SVN.

add edit

rm

checkout

revert

commit

commit

Page 12: With git

private branches, merge, edit commits(rebase), revert, log tracking,blaming, reflog, cherry-pic,tags, etc...

Other many utils

Page 13: With git

#SCMBCSCM Boot Camp

in Tokyo30.7.2011 @ORACLE

http://kokucheese.com/event/index/14062/

Page 14: With git

case: Group work

(SetucoCMS)

Page 15: With git

Git branches are also useful.

Internal structure of git repos master ----------------------------------- branch1 ----------------------------------- branch2 ----------------------------------- ... -----------------------------------branches form a commits tree.

Branches

Page 16: With git

Git repos branches: master - main workspace has always newest commit issXXX - topic branch for development, bugfix, for master X.X - release branch, has bug fix tags

SetucoCMS tree

Page 17: With git

Git repos tags: X.X.X - bug fixes or refactorings on release branch X.X

SetucoCMS tree

Page 18: With git

master -*------*--------*------- *:commit \ /\ / \ iss123 *--* \ / \ \ \ / \ 1.0 \ *------・----・--- ・:tag \ / \ iss124 *--*--* \ \ iss125 *----

Each branch has own history, and we can merge them, delete, add, get, push or pull at any time.

Tree example

1.0.1 1.0.2

branches

Page 19: With git

I decided to do away with Stage branch. Stage branch’s advantages - careful confirmation - modify safely Disadvantages - long about work - possibillity of mistake - difficult to leaning git

Repeal of stage