preface

Hello everyone, I am Bai Mo, a love of learning and swimming contradictions.

When I first came into contact with collaborative development, I was really confused. SVN? Git? What the hell is that?

Our tutor asked us to use SVN, which was not convenient after we learned about it. For group projects between classmates, we had to use a computer as a server to submit codes and other things, and we had to penetrate the Intranet. It’s too much trouble.

Others recommended me to use the code cloud, I tried it, really sweet ah ~ so specially organized a tutorial, convenient with me like I have no contact with Git and need to use the small white.

The way GitHub connects to IDEA is much the same.

Download and install Git

1. Go to the Git website and select your operating system

Official website download address: https://git-scm.com/downloads

2. Select the appropriate version to download according to your system number

System bits are generally 64 bits.

Forget it, just download 32 bits! No problem, no problem!

If you want to see it but don’t know where to see it, click here.

By the way, if the network has problems and the download is slow, you can pay attention to my public account “Bai Mo is a program ape” to send “git” to get files, and “git official Chinese manual” PDF e-book.

3. The installation

Open the exe file you downloaded.

Next is the easiest way to do this, and the more complex options are not needed.

Remember your installation directory during the installation process. Default in “C: Program Files” directory.

4. Configure the global user name and mailbox

After the installation is complete, you need to configure the user name and mailbox. You have to have an identity when you submit code to someone else’s repository, right? That’s what it does. Just use your Gitee registered email address.

Open the System menu in the lower left, find Git Bash, and click Open.

Enter the following code separately and press enter. Make sure to change the user name and email address in the quotes to your own.

Git config --global user.name "git config --global user.email"

If you do not configure username and email, the following window will pop up in the future. You can also configure it:

5. Configure the git directory in IDEA

1. Select the File TAB of Idea and select Settings to open the Settings

2. Select Git 3 under Version Control. Select the three points 4. Select bin–>git.exe in your Git installation directory and click OK

5. Click “Test”, and the version number will appear.

Configure the Gitee plug-in

Prepare ahead of time: Code Cloud Account (https://gitee.com/) 1. Select the File TAB of Idea and select Settings to turn on the Settings

2. Install Gitee, the official cloud plug-in

2.1 Select Plugins, enter Gitee in the search box, and click “Search in Repositories” to search for the repository

2.2 Select the Gitee installation in the search results

2.3 Click to restart Idea after installation

3. Configure Gitee’s API Token

3.1 Open the Settings page, select “Gitee” under Version Control 3.2 Click “Create API Token” on the right 3.3 Enter the Login name and password in the pop-up Login box, and click “Login” to Login

Note that the user name here is not your phone number or email address, but the user name in your cloud personal home page

3.4 Test success after login

III. Cloning and uploading projects

Cloning project

  1. Find the project address on a project hosting site such as CodeCloud or GitHub: Open the project and click the”cloning“And then copy the project address

  1. Select the”File“- >”New“- >”Project from Version Control“- >”Git

  1. In the”URLEnter the address of the project copied in the first step and clickTest.”Connection successful“Connected successfully in the”Directory“Select the save address and click”Clone

  1. Waiting for the clone. Open the project, and you’re done.

Upload the project

1. Open the Project, select “VCS” –> “Import into Version Control” –> “Share Project on Gitee”

2. Fill in the project name “New Repository Name” and the project Description “Description”, select whether it is private, and click “Share” to upload

3. For the first time, pop up this window, and enter your account and password of the cloud

4. After the idea is successful, open the code cloud and you can see the items you share

IV. Update the project

Once you’ve completed one of these steps, it’s much easier to update and pull projects for collaborative development.

Push your own updates

1. After the code has been modified, click “VCS” –> “Commit…” in the toolbar. Or the green check mark (any one of the images below will do)

2. Check the information and click Commit (the layout of the latest version of IDEA has changed -2021.06.23)

3. If there is a warning, you can check it. If you do not want to check it, you can simply “Commit” it.

4. Submission successful. Note: there is a difference between submit and push. The submit step does not update the code to the server!

Commit multiple.

5. Push to the server, click “VCS” –> “Git” –> “Push…”

Push results:

Pull for updates from colleagues

To avoid code conflicts, pull updates before each code change.

1. Click “VCS” on the toolbar –> “Update Project…” Or the small blue arrow pointing to the lower left corner (either of the following images will do)

2. Use the default option and click OK to update.

3. Check the prompt in the lower right corner. Since the project here is the same as the one on the server, it prompts “All files are the latest version”.

Afterword.

Well, that’s all for this article! This article has been written for a long time, at that time of their own Git is also a little understanding, this tutorial, for small white enough, also no problem.

Git still has a lot to learn, such as the use of code cloning, push, code conflict resolution, if you have time or suggest to study the system, the relevant courses are available in B station.

I am Bai Mo, a love of learning and swimming contradictions. A new person who just started to write blog, the quality will be higher and higher in the future, welcome to witness together! Would you care to pay attention? Would you care to pay attention? Pay attention ~