with git
TRANSCRIPT
SetucoCMS @akitsukada
developmentwork flow
with Git
case: Local work
1 of the three major affairs for modern software development!
Version Control
Test
Automation
VCS
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
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
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
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
Git has 5 areas for tracking.- local - untrack -------------------------------------- track -------------------------------------- modified -------------------------------------- index --------------------------------------- remote - remote --------------------------------------Index is also called “Stage” or “Cache”.
Git repos world
SVN has no index.- local - untrack -------------------------------------- track -------------------------------------- modified --------------------------------------- remote - remote --------------------------------------
FYI, if SVN...
untrack ----------------------------------------
track ----------------------------------------
modified ----------------------------------------
index ----------------------------------------
remote ----------------------------------------
Flexibility by Index
add
editadd
pushcommit
reset
reset --hard
rm --cached
pull/clone
untrack ----------------------------------------
track ----------------------------------------
modified ----------------------------------------
remote ----------------------------------------
FYI, if SVN.
add edit
rm
checkout
revert
commit
commit
private branches, merge, edit commits(rebase), revert, log tracking,blaming, reflog, cherry-pic,tags, etc...
Other many utils
#SCMBCSCM Boot Camp
in Tokyo30.7.2011 @ORACLE
http://kokucheese.com/event/index/14062/
case: Group work
(SetucoCMS)
Git branches are also useful.
Internal structure of git repos master ----------------------------------- branch1 ----------------------------------- branch2 ----------------------------------- ... -----------------------------------branches form a commits tree.
Branches
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
Git repos tags: X.X.X - bug fixes or refactorings on release branch X.X
SetucoCMS tree
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
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
Let’s read wiki...
How to drive our git repos http://bit.ly/setuco_drivegit How to release SetucoCMS http://bit.ly/setuco_release
Setuco without stage