One, prepare the environment

1. Install the Git environment and GitHub in advance for integration without further explanation; 1. Prepare the wechat project code; 2. Create a GitHub repository.

Create a GitHub repository

1. Create an empty GitHub repository, without any files or branches, which will be imported from wechat development tools. (Just fill in the name, do not check other boxes, check will create their own master branch, there is no need to create a branch, if still check, later will talk about how to merge wechat local version branch into this branch)2, create a copy of the project address, useful later

Third, wechat version tool integration with GitHub

1. Open wechat development tools and import local projects;2. Open version Management in the upper right corner and initialize the local Git environment3. After the initialization, open the Settings and add the GitHub account password and project address.Switch to the Original menu and click Add:Click OK, you can directly push to Github, the name of the name, then github inside the branch to the name, here select the following branch is equivalent to github new branch;You can see the master tag, GitHub tag and head tag together, indicating that the integration has been completed, you can also go to GitHub to see the project; At this point, wechat version management and GitHub integration is complete;

Supplement: GitHub already has branches. If GitHub already has branches, GitHub will not be able to push to the new branch according to the above. This will result in two branches of GitHub. This way the native code is new and can be submitted to the GitHub branch.

Three, push, grab, pull

1 push: after the local code changes, the changes will be synchronized to the workspace, just check submit directly;Then you can go to the local branch and see the latest submission, and push it directly to GitHub.Push do not select a new branch, select just established branch line;2 grab, directly select the branch just on the line;3 pull, pull, this applies to GitHub on the existing project to local, overwrite the local development;

Fourth, pull GitHub project to local development

1. Create an empty project;2, open version control, do not check, make sure it is a clean project, merge the whole later;3, enter the GitHub account password and remote project address, as above;4. Next, grab the remote warehouse just added;5, after successfully fetching, you can see the latest GitHub code. Next important point is to right-click the latest submission point, and reset the head of GitHub’s latest submission point to ensure that your local workspace is associated with it.I don’t have to check it in the popover, but I don’t need it in the local code;6, the next step is to click pull to overwrite GitHub code locally, so choose change base below;7, after the completion of the transformation, the project is basically covered, and the rest is development, submission and so on…

Git has its own meaning for each tag, such as master, head, etc., which will be covered in the next section;