git workflow advanced - trung tâm lập trình codeto vietnam
TRANSCRIPT
![Page 1: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/1.jpg)
Workflow and Advanced Tips
CODETO@2015/11/09
![Page 2: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/2.jpg)
GIT OVERVIEWWORKFLOWBENGO4 WORKINGADVANCED TIPS
Trung tâm lập trình CODETO@2015/11/09
![Page 3: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/3.jpg)
GIT
Trung tâm lập trình CODETO@2015/11/09
![Page 4: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/4.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 5: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/5.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 6: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/6.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 7: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/7.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 8: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/8.jpg)
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
![Page 9: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/9.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 10: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/10.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 11: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/11.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 12: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/12.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 13: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/13.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 14: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/14.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 15: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/15.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 16: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/16.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 17: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/17.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 18: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/18.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 19: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/19.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 20: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/20.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 21: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/21.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 22: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/22.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 23: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/23.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 24: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/24.jpg)
![Page 25: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/25.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 26: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/26.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 27: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/27.jpg)
Trung tâm lập trình CODETO@2015/11/09
![Page 28: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/28.jpg)
BENGO4 (in practice)
Trung tâm lập trình CODETO@2015/11/09
![Page 29: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/29.jpg)
BENGO4 (in practice)
Trung tâm lập trình CODETO@2015/11/09
![Page 30: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/30.jpg)
ADVANCED TIPS
Merge vs Rebase
Reset/Checkout/Revert
Git Log
Trung tâm lập trình CODETO@2015/11/09
![Page 31: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/31.jpg)
ADVANCED TIPS
Merge vs Rebase
Reset/Checkout/Revert
Git Log
![Page 32: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/32.jpg)
Merge vs Rebase
Merge• git checkout feature • git merge master
Trung tâm lập trình CODETO@2015/11/09
![Page 33: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/33.jpg)
Merge vs Rebase
Rebase• git checkout feature • git rebase master
Trung tâm lập trình CODETO@2015/11/09
![Page 34: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/34.jpg)
Merge vs Rebase
MergeEasy & SimpleNew merge-commitMess history
RebaseDangerous & FlexibleMove all commits to HEADNatural 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
![Page 35: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/35.jpg)
Reset/Checkout/RevertReset• Remove commits in current branch• Move HEAD to PREVIOUS commits in local repo
Trung tâm lập trình CODETO@2015/11/09
![Page 36: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/36.jpg)
Reset/Checkout/RevertReset• Soft• Mixed• Hard
Trung tâm lập trình CODETO@2015/11/09
![Page 37: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/37.jpg)
Reset/Checkout/RevertCheckout• Switch branches• Bring changes from another branch• Back to previous commit
Trung tâm lập trình CODETO@2015/11/09
![Page 38: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/38.jpg)
Reset/Checkout/RevertRevert• Safe way to undo changes• Create new commits for roll-back commits
Trung tâm lập trình CODETO@2015/11/09
![Page 39: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/39.jpg)
Git loggit 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
![Page 40: Git workflow advanced - Trung tâm lập trình Codeto Vietnam](https://reader035.vdocuments.pub/reader035/viewer/2022062412/589fd5bb1a28abf06d8b5d6f/html5/thumbnails/40.jpg)
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