Git is a free and open source distributed version control system for managing code and development projects. The basic concepts and usage of Git are as follows:
1. Warehouse (Repository): Git uses warehouses to store code and version information. Warehouses can be local or remote.
2. Branch (Branch): Git allows the creation of branches to modify and develop the code, and develop without affecting the mainline code.
3. Commit: Git uses commit records to record the modification history of the code. Each commit contains a commit message and changes to the code.
4. Merge (Merge): Merge the code of two branches or multiple branches into a new branch.
5. Stage: Before submitting the code, you can use the stage function to add the code to the stage and wait for the one-time submission.
6. Clone: Clone the code from the remote warehouse to the local.
7. Pull: pull the code from the remote warehouse to the local.
8. Push (Push): Push the local code to the remote warehouse.
The basic steps to use Git are as follows:
1. Initialize the local warehouse: Use the git init command to initialize the local warehouse.
2. Add files: Use the git add command to add files to the temporary storage area.
3. Submit the code: Use the git commit command to submit the code to the local warehouse.
4. Create a branch: Use the git branch command to create a branch.
5. Switch branches: Use the git checkout command to switch branches.
6. Merge branches: Use the git merge command to merge branches.
7. Clone the code: Use the git clone command to clone the remote warehouse to the local.
8. Pull the code: Use the git pull command to pull the code from the remote warehouse to the local.
9. Push code: Use the git push command to push the local code to the remote warehouse.