微信小程序开发笔记[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,可能需要检查系统的代理设置
分类:
前端开发 / 微信小程序
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」