微信小程序开发笔记[2]-团队多人协作

开始使用微信的git仓库

[https://git.weixin.qq.com]
(管理员)
新建一个仓库,新建master分支
复制仓库ssh地址
个人中心添加电脑的ssh密钥
cat ~/.ssh/id_rsa.pub

进入本地的小程序项目目录

git init 
git remote add origin git@git.weixin.qq.com:qsbye/qs-balcony.git 
git add .
git config user.name "用户名"
git config user.email "邮箱"
git commit -m "first commit"
git push -u origin master

注意,要去除保护再强制推送

提示:git config有三个级别:--system是系统层的,优先级最低;--global是用户层的,优先级次之;不带这两个参数的(或者--local)是仓库层的,优先级最高。

git多人协作

(管理员)
添加成员

(其他成员)
个人中心添加电脑的ssh密钥
cat ~/.ssh/id_rsa.pub

git用到的用户名和邮箱在这里

进入本地小程序项目目录

git init
git remote add origin git@git.weixin.qq.com:qsbye/qs-balcony.git 
git config user.name "用户名"
git config user.email "邮箱"
git pull origin master    //获取最新代码

修改完成后

git add .
git commit -m "备注“
git push -u origin master

微信开发者工具导入项目目录即可

注意:AppID导入项目文件夹时会自动填写
这个文件夹大致结构:

.
├── README.md
├── cloudfunctions
│   └── quickstartFunctions
│       ├── config.json
│       ├── createCollection
│       │   └── index.js
│       ├── getMiniProgramCode
│       │   └── index.js
│       ├── getOpenId
│       │   └── index.js
│       ├── index.js
│       ├── package.json
│       ├── selectRecord
│       │   └── index.js
│       ├── sumRecord
│       │   └── index.js
│       └── updateRecord
│           └── index.js
├── hello
├── miniprogram
│   ├── app.js
│   ├── app.json
│   ├── app.wxss
│   ├── components
│   │   └── cloudTipModal
│   │       ├── index.js
│   │       ├── index.json
│   │       ├── index.wxml
│   │       └── index.wxss
│   ├── envList.js
│   ├── images
│   │   ├── arrow.svg
│   │   ├── database.png
│   │   ├── deploy_step1.png
│   │   ├── deploy_step2.png
│   │   └── temp_bg.jpg
│   ├── pages
│   │   ├── createCollection
│   │   │   ├── index.js
│   │   │   ├── index.json
│   │   │   ├── index.wxml
│   │   │   └── index.wxss
│   │   ├── deployService
│   │   │   ├── index.js
│   │   │   ├── index.json
│   │   │   ├── index.wxml
│   │   │   └── index.wxss
│   │   ├── getMiniProgramCode
│   │   │   ├── index.js
│   │   │   ├── index.json
│   │   │   ├── index.wxml
│   │   │   └── index.wxss
│   │   ├── getOpenId
│   │   │   ├── index.js
│   │   │   ├── index.json
│   │   │   ├── index.wxml
│   │   │   └── index.wxss
│   │   ├── index
│   │   │   ├── index.js
│   │   │   ├── index.json
│   │   │   ├── index.wxml
│   │   │   └── index.wxss
│   │   ├── selectRecord
│   │   │   ├── index.js
│   │   │   ├── index.json
│   │   │   ├── index.wxml
│   │   │   └── index.wxss
│   │   ├── sumRecord
│   │   │   ├── index.js
│   │   │   ├── index.json
│   │   │   ├── index.wxml
│   │   │   └── index.wxss
│   │   ├── sumRecordResult
│   │   │   ├── index.js
│   │   │   ├── index.json
│   │   │   ├── index.wxml
│   │   │   └── index.wxss
│   │   ├── updateRecord
│   │   │   ├── index.js
│   │   │   ├── index.json
│   │   │   ├── index.wxml
│   │   │   └── index.wxss
│   │   ├── updateRecordResult
│   │   │   ├── index.js
│   │   │   ├── index.json
│   │   │   ├── index.wxml
│   │   │   └── index.wxss
│   │   ├── updateRecordSuccess
│   │   │   ├── index.js
│   │   │   ├── index.json
│   │   │   ├── index.wxml
│   │   │   └── index.wxss
│   │   └── uploadFile
│   │       ├── index.js
│   │       ├── index.json
│   │       ├── index.wxml
│   │       └── index.wxss
│   └── sitemap.json
├── project.config.json
├── project.private.config.json
└── uploadCloudFunction.sh

其实这样配置完成后就可以很方便地在微信开发者工具的版本管理进行可视化操作了

推送时报错Error

看看有没有设置过git config --global http.proxy,可能需要检查系统的代理设置

posted @ 2022-08-04 05:05  qsBye  阅读(566)  评论(0编辑  收藏  举报