Environment configuration | Git installation and configuration [graphic details]

  Git is an open source distributed version control system that can effectively and quickly handle version management of small to large projects. The following introduces the basic concepts and describes the git installation process in detail in graphic form.

Table of contents

1. Basic concepts of Git

2. Git download and installation

3. Common git commands

Advanced Git Tips

Git and teamwork


1. Basic concepts of Git

  • Repository: Explain the concept and function of warehouse
  • Commit: Explain the meaning and role of the commit operation
  • Branch (Branch): introduces the concept and usage of branches
  • Merge: Explain the method and strategy of merging branches
  • Remote Repository: Explain the use and management of remote warehouses

2. Git download and installation

Open the git official website address: Git to download, as shown in the following interface:

 The version will be automatically identified here. At present, the new computers are basically 64-bit, click to download

 After downloading, double-click to run,

 Here is the storage location of git, the default c disk, you can change it to the location you want to store (I changed it to D disk)

 The next step is to click Next (Next)

The default editor for git files  here :  Vim by default, can be modified in the drop-down box, can be modified to submit, VSCode, etc., it is recommended not to move, just click Next to enter the next step

 Set the name of the initial branch in the new repository: the  default name of the initial branch is "master". If you want to modify it, you can choose the second one, just enter the content in the text box, it is recommended not to move, just click Next to enter the next step

Adjust the Path environment:  It is recommended not to move, use the default configuration, click Next directly to enter the next step

 

 

 

 

 

 

 Just click to install~

 

 After clicking Finish, the installation is complete~

Whether the verification is successful

After the installation is complete, let's test whether it is installed. Right-click on the desktop, we can see that there will be two options in the figure below, namely "Git GUI Here" and "Git Bash Here", and the corresponding interface will appear after clicking the two options

Git GUI is a visual operation tool for Git (Git GUI Here, open Git GUI here)
Git Bash is a console supporting Git (Git Bash Here, open Git Bash here)
✌You can also verify commands

git -v

3. Common git commands

# 克隆项目
git clone 项目地址

# 创建一个新的Git仓库
git init

  • git init: Create a new Git repository
  • git clone: ​​clone the remote warehouse to the local
  • git add: add files to the temporary storage area
  • git commit: Submit code changes to the warehouse
  • git push: push the local code to the remote warehouse
  • git pull: Pull the latest code from the remote warehouse
  • git branch: manage the creation, switching and deletion of branches
  • git merge: method of merging branches and conflict resolution
  • git log: View commit history and change records

  • Advanced Git Tips

    • Ignore files: introduce the function and configuration method of .gitignore files
    • Undo operation: explain how to undo submission, roll back version and modify history
    • Tag Management: Explains what tags do and how to create, view, and delete tags
    • Submodule: Introduces the concept and usage of submodules to manage dependent external code bases
  • Git and teamwork

    • Pull Request: The concept and use of Pull Request
    • Collaborative development: Introduce the workflow of multi-person collaboration and the method of conflict resolution
    • Branch strategy: explain commonly used branch management models, such as Git Flow and GitHub Flow

 

Guess you like

Origin blog.csdn.net/weixin_44649780/article/details/131313812