How to use the version management of WeChat Developer Tools

Table of contents

How to add local project to remote repository

How to check out the project from the remote warehouse to the local


How to add local project to remote repository

step:

1. Create a project. In the WeChat developer tools, create a new Mini Program project.

2. Initialize the Git repository. If no Git warehouse is found under the project folder where it is located, it will prompt to initialize the Git warehouse, you can choose whether to submit all files immediately, and automatically generate a .gitignore file template.

Supplementary Note: If you select "Submit all files immediately" in this step, a local branch will be created by default, and the code will be submitted to this local branch.

3. Add the remote library. In the setting "Remote" of the workspace, add the remote warehouse information. Here you can choose to use the remote warehouse provided by WeChat, or add other remote warehouses.

4. Authentication method setting. If the proxy or user authentication settings are required to connect to the remote warehouse, you can configure them in the settings "Network and Authentication". Here I choose the username and password.

5. User information settings. It can be configured in the settings "General". After the configuration is completed, the user name and email address will be used for the next submission.

6. Commit the code. Check the files that need to be submitted, fill in the description, and after submission, you can view the submission record on the local warehouse branch.

7. Push the code. Push the code from the local branch to the remote warehouse. In the push dialog box, select "Push to the following remote warehouse branch" and select the branch of the existing remote origin warehouse master.

 

How to check out the project from the remote warehouse to the local

The difference between pulling and grabbing

pull (pull), pull down the remote branch and merge with the local branch.

fetch (fetching) just pulls down the remote branch without merging the local code

Steps: The previous steps 1-5 are the same as the previous operation of adding a remote library locally. For specific operations, refer to the previous description.

1. Create a project;

2. Initialize the warehouse;

3. Add remote library;

4. Set the authentication method;

5. Set user information;

6. Grab the remote warehouse code; after successful grabbing, you can see that there is an additional branch under the remote.

 

7. Create a local branch. Right-click on the remote master branch and select "Check out origin/master locally". After the checkout is successful, you can see that there is a master branch in the local branch.

Note: The purpose of steps 6 and 7 is to create a local branch by grabbing and checking out the remote branch code. Because, I did not find any other way to create a local branch, nor can I directly create a branch on the tool (click the branch, and a question mark appears on the interface). After the local branch is created for the first time, it can be created directly through the "branch" function of the tool later.

8. Since the local is a new project and there is an inconsistency with the remote code, you can right-click on the "Workspace" and select "Discard All Changes", so that the local code is consistent with the remote code.

 

Guess you like

Origin blog.csdn.net/dingyuan9433/article/details/115214294