basic principles of git
DESCRIPTION
Basic Principles of GitTRANSCRIPT
![Page 1: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/1.jpg)
Basic Principles of Git
Vo Huy Phuong
![Page 2: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/2.jpg)
Basic Principles of Git
• What is Git
• Basic Operation with Git and How Git organize data.
• What is Branch and basic operation with branch
• Repository and Remote Branch
![Page 3: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/3.jpg)
What is Git
• What is Version Control System– System that record the changes of a file or set of
file overtime.
• How many kind of Version Control system:– Centralized Version Control System– Distributed Version Control System
• Git and SourceTree
![Page 4: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/4.jpg)
Centralize Version Controll System
![Page 5: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/5.jpg)
Distributed Version Controll System
![Page 6: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/6.jpg)
What is Git
• Git is distributed Version Control System
• Provide a rich, full command line for user to manipulate data.
• SourceTree is application, provide a visual interface for user to do with Git system.
![Page 7: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/7.jpg)
Basic Operation and How Git organize data
• Organize data into a three State:– Git directory(repository)– Working Directory– Stage Area
![Page 8: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/8.jpg)
How Git organize data
![Page 9: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/9.jpg)
How Git organize data
• How Repository organize data– Organize data into Tree– Has many leafs(commit object) that link together– Each commit has a snapshot of file/set of file that
changed• An HEAD pointer to indicate the current status
we are on• HEAD pointer will move forward if we commit
![Page 10: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/10.jpg)
How Repository organize data
![Page 11: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/11.jpg)
How Repository organize data
![Page 12: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/12.jpg)
How Repository organize data
![Page 13: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/13.jpg)
Basic Operation
• Some basic operation– Git Add : add file to State area– Git Checkout : reset the changed file in Working
area– Git Reset : reset HEAD to specific commit– Git Status : view the status of Working Area, and
State Area
![Page 14: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/14.jpg)
Basic Operation
• Some basic operation– Git rm : deleted a file from repository– Git Commit: create the commit obj from the State
Area..and update Tree– Git mv : move file from one location to another
location– Git Log: show history in repository
![Page 15: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/15.jpg)
What is Branch and basic Operation with Branch
• Branch is one part of Git Tree• Permit User to work independently with
another branch• Branch is actually a movable pointer, that can
move forward or downward commit object in Git Tree
![Page 16: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/16.jpg)
How Repository organize data
![Page 17: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/17.jpg)
What is Branch and basic Operation with Branch
![Page 18: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/18.jpg)
What is Branch and basic Operation with Branch
• Basic Operation with branch– Git checkout : create or change branch– Git merge : merge one branch with another
branch
![Page 19: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/19.jpg)
Basic Merge in Branch
![Page 20: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/20.jpg)
Basic Merge in Branch
![Page 21: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/21.jpg)
Basic Merge Conflict
![Page 22: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/22.jpg)
Repository
• Basic Operation with repository– Git fetch : Synchronize local database with server
database– Git clone : create new local database and create
working copy for all file
![Page 23: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/23.jpg)
Remote Branch
• Remote Brach is movable pointer that represent the current status of this branch on server
• Git has difference pointer for one branch:1 for remote branch and 1 for local branch
• Operation in Branch:– Git merge : merge one branch with another branch– Git pull : fetch one branch and merge local branch
with remote branch– Git Push : push branch data to remote repository
![Page 24: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/24.jpg)
Remote Branch
![Page 25: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/25.jpg)
Remote Branch
![Page 26: Basic principles of Git](https://reader035.vdocuments.us/reader035/viewer/2022062307/556204d4d8b42ae04e8b59b2/html5/thumbnails/26.jpg)
Basic Principles in Git
• Reference : http://git-scm.com/book