8. DEVELOPMENT
o Reflects the latest development
TESTING/STAGING
o Code is deployed to testing/staging environment
MASTER
o Code is deployed to production
Trung tâm lập trình CODETO@2015/11/09
32. Merge vs Rebase
Merge
• git checkout feature
• git merge master
Trung tâm lập trình CODETO@2015/11/09
33. Merge vs Rebase
Rebase
• git checkout feature
• git rebase master
Trung tâm lập trình CODETO@2015/11/09
34. Merge vs Rebase
Merge
Easy & Simple
New merge-commit
Mess history
Rebase
Dangerous & Flexible
Move all commits to HEAD
Natural history
Dangerous rebase
• Never rebase on master branch
• About to re-base a public branch (pushed)? Anyone are working on?
• Don’t sure – don’t use
39. Git log
git log (useful in command line)
• --oneline (display in single line)
• --decorate (display in branches point to each commit)
• shortlog (display short,readable commits group by author)
• --graph --oneline –decorate (draw graph in cli)
• --pretty=format:"%cn committed %h on %cd“ (custom log format)
• -<number> (most recent commits)
• --after="2014-7-1“--before="2014-7-4“ (after and before)
• --author="John“ (filter by author)
• -- <file>
• --<branch a>..<branch b>
• …
Trung tâm lập trình CODETO@2015/11/09
40. SUMMARY
Great workflow and collaboration!
Powerful branching & merging
Fast and smaller than ever before ..
Local repo - network out, everything still fine
…
Trung tâm lập trình CODETO@2015/11/09