current position:Home>WeChat applet uses github collaboration

WeChat applet uses github collaboration

2022-11-24 22:38:11gujunhe

微信小程序githubFor collaboration related Settings

1.Click the development tools in the top right corner of the version management meet the local repository:


2.去github新建一个仓库,复制仓库的ssh的urlAdded to the warehouse set in the remote connection:



3.In the warehouse set in the general set up their own user name and email


4.生成ssh key

由于我们使用ssh的连接方式,So we're going to generatessh key,In a small program WeChat terminal, enter the following command in the.

注意:Some blog gives is thatssh-keygen -t rsa -C
[email protected]”,This way there will be a mistake,在2022年3月15日之后,github不再支持SHA-1的加密方式了,所以我们将SHA-1的加密方式修改为ECDSA的方式,如下:

1.In the project root item respectively carry out:
  Pay attention to follow changename和email.nameIs the name of the submit code record to see
// This two sentences if in the first3Step set up,Here need not perform
git config --global "张三"
git config --global "[email protected]"
// This email and set up aboveemail保持一致
ssh-keygen -t ecdsa -b 521 -C "[email protected]"
// 之后一直点回车,遇到yes/noPrompt inputyes
Generating public/private rsa key pair. Enter file in which to save the key (C:\Users\Administrator/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\Administrator/.ssh/id_rsa. Your public key has been saved in C:\Users\Administrator/.ssh/ The key fingerprint is:
The key's randomart image is:
+---[RSA 3072]----+
|        . =   .  |
|     . . O . o   |
|    . + = 6 +    |
|     . @ A = .  o|
|      = S % .  .o|
|       + * * o ..|
|        . C + o.o|
|           =  .*.|
|              o+=|
// Shown above is said to generate success,保存在:C:\Users\Administrator/.ssh/

生成好了之后会在~/.ssh目录中看到多出两个文件id_ecdsa和,分别为私钥和公钥.(Path to know,等会有用)Here may also encounter a mistake,The path of the file if contains Chinese may go wrong.


在github的setting中找到SSH and GPG keys并点击 New SSH key:

Copy we just in terminal WeChat small program to generate public key(后缀为.pub)粘贴到key中,title自己取:

6.Set WeChat applet authentication to usesshkey

Path is we just productionsshkey的路径,Password password isGithub的密码:


Developers can be added to thegithub的仓库:
Can be initiated for developers to build branch merge,Can agree to the developer's merge request,To solve conflict is encountered to merge


When we set the related set up,就可以开始使用,We can see our warehouse in remote warehouse,Warehouse is no content at this moment:

We get to the remote warehouse by scraping content,After fetching can see remote warehouse code and submit:
如果是第一次创建项目,First to use the right mouse button click remote warehouse latest submit,With the latest submitted will beHEAD重置(And don't check the keep workspace content,So local warehouse code can and remote warehouse latest code consistent):

Developers must first submit after finish his part of the code to the local branch,再进行推送,Otherwise directly push is originally a local branch without modifying the code,Write code before and after the code is a good idea to pull the latest project 再push:
Push the new own branch,Instead of directly submitted to the main branch:
Can put your own local branches to trackmaster,So you can see yourself behind several versions To update the local code.After successful push to their branch can initiate branch merge,Administrators agreed to after their own code and branch office.

copyright notice
author[gujunhe],Please bring the original link to reprint, thank you.

Random recommended