About the author: A freshman student
Personal homepage: The moon chews into a star~
Personal WeChat: yx1552029968
Series Column: Daily Summary
A sentence of the day: It is easy to mess around, but it also means staying where you are and not growing.
background
Git is a version control tool. It mainly solves three problems
1. The code is eaten by the cats.
2. The product manager repeatedly modifies the requirements and needs to maintain multiple versions of the code at the same time
.
The same-sex social networking site". Through git, you can upload the code to Github and share it with users around the world.
Download and install
Install git for windows
This is a command line version of git windows system
https://git-scm.com/downloads
or
https://pan.baidu.com/s/1kU5OCOB#list/path=%2Fpub%2Fgit
installation tortoise git
This is the graphical interface of git.
https://tortoisegit.org/download/
Note:
1. Install git for windows first, then install tortoise git
2. Install git for windows and go all the way to next.
3. Install tortoise git You need to configure git.exe, which is part of git for windows. If git for windows is successfully installed, you can use the default result in this step.
4. To install tortoise git, you also need to configure your name and email, which should be filled in with Github's email as much as possible. Consistent.
5. After the two tools are installed, you need to restart the computer to use them correctly.
Create a project with Github
Register an account
This is relatively simple, just refer to the official website tips. Email verification is required.
Create project
1. After successful login, enter the personal homepage, click the New repository button in the lower left to create a new project
2. Then jump to the new page and enter the project name (note that the name cannot be repeated, the system will automatically verify it. The verification process may take a few seconds). After verification, click the Create repository button below to confirm the creation .
3. Copy the link of the project in the created project page for the next download.
Download project to local
1. Copy the link of the project you just created.
2. Open the specified directory where you want to place the project
3. Right-click the directory, and click Git Clone
4. Enter the link of the project you just copied in the pop-up dialog box.
If the download is successful, a green icon will appear.
The three axes of Git operation
The use of Git requires the installation of two software, Git and TortoiseGit.
Git 2.31.1 installation steps → Git 2.31.1 installation .
TortoiseGit-2.8.0.0 installation steps → TortoiseGit-2.8.0.0 installation .
put in code
Use VS to create a project, and put the project in the project path you just downloaded to the local.
Or copy the project directory of the code you have written to the project directory directly.
The first trick of the three-axes: git add
Tell the git tool which files need to be version managed.
Right-click on the directory marked with blue? (indicating that the file is not managed by git), and select add
In the pop-up dialog box, check the specific files that need to be managed. After checking, click ok.
At this time, the icon turns into a red exclamation mark (indicating that the file is managed by git, but the content has not been submitted)
The second trick of the three-axes: git commit
Submit the modified content to the local
Each time it is submitted, it is a version. For example, after developing a functional module, it can be submitted once. Subsequent version rollbacks are subject to submission.
Note: At this time, it is only submitted to the local, Github No code changes can
be seen on
At this point, a dialog box pops up. You can see which files need to be submitted here, as well as the specific changes of each file. And you need to enter the submission log. Describe the reason for the specific changes in this submission. This log is a follow-up An important reference for version rollback.
Click the Commit button below to complete the submission.
The third trick of the three-axes: git push
The submitted content needs to be synchronized to the server so that other people can see the changes. Just use push.
Right-click on the directory that needs to be pushed, and click the push
dialog that pops up to confirm the push. No modification is required, just confirm it directly.
Then a dialog will pop up A box prompts you to enter your Github account and password.
Enter the correct username and password, click Login to complete the push. At this point, refresh the Github interface, and you can see the new version of the code.
Summary
I have mastered the basic operations of Git & Github above, and I hope that all of my friends can use Github , record your own learning process, and create your own business card. If your Github calendar can be green, this is the most powerful evidence to prove your reliability to the interviewer.
The above is all the knowledge of this article. If you like to read this article and gain something, you can support the blogger and pay attention to the blogger for three consecutive times. Your attention is the greatest encouragement to me and my creative motivation~!
Thanks again for watching, and for your support!