Git is a repository and it stores files. Versions are well maintained.
Git projects will have below access
- Public -> Any one with URL can access the code.
- Private-> Access based and should have credentials
We will have a local repo which we configured and it can be on the local system or on the network. We can make code changes and commit them locally . We use PUSH command to commit changes to the repo. Pull needs to be done before Push since pull gets us all the modifications done by fellow team members. When we do a Pull request all commits made by other developers will be merged to our code and manual merges are required if they were not resolved.
Commands:
- PUSH -> Used to commit changes to the repo.
- CLONE -> Used to check out / download code from the repo
- PULL -> Used to get latest content from repo.
Branches :
Creating branches is really easy and it will store only =modifications unlike all contents of all files. It is always better to create new branches for developing features / enhancements. As an example if there 8 features that needs to be developed and all features may not be developed at one shot . At the same time few features may have impediments and creating branches with feature enhancement will make it easy to go for implementation even if few features were not implemented.
DEV < — > MASTER
Dev would be a stable development branch.
Master is the one that has the active PROD Code.
In case of defect fixes we create a branch from master and make code changes to it. We later do a PULL Request to the Dev branch so that code will be available on Dev and later another PULL Request to Master.
GIT Clients :
We can use command line arguments or use any of the following UI tools
Source Tree , tortoise GIT, Eclipse Plugin, Git Bucket.