training-plan
training-plan copied to clipboard
关于training-plan后续发展与管理的讨论与记录
General Question
关于新生学习计划training-plan后续发展与管理的讨论与记录,包括但不限于仓库版本纪要、仓库组织框架,作业规范,重要管理命令,对外使用,如果有需要优化的地方一起讨论:
仓库版本纪要
2019-07-06
仓库上线#11:rocket:
2021-01-13
2020级归档[#28 ,training-plan-2020]:baby:
仓库组织框架
每一级从template分支拉一个私仓开始学习计划,结束后整理归档回公仓,及时对template和homework打上tag。
- tag命名形式 homework2020 homework2021 homework2022 template2020 tempalte2021 tempalte2022
- 分支结构
├─master // 目前是2020级的作业,后续可以改名 ├─template // 计划模板,应不断更新,与时俱进 ├─training_plan_2020 // 20级归档 ├─training_plan_2021 // 21级归档 └─training_plan_2022 // 22级归档
作业规范
代码规范
google-cpp-style google-python-style uber-golang-style ...
PR规范
关于实验室项目多人协作开发流程的讨论
重要管理命令
从template拉取私仓
- github上新建一个私仓
- 添加公仓作为 public remote
git remote add public [email protected]:CDDSCLab/training-plan.git - 切到public/template
git checkout public/template - 将public/template
push到新建的私仓上面
从私仓中cherry-pick做得好的PR
- 添加私仓作为remote
git remote add private git://gitUrl - 拉取不合并
git fetch private - 查看想要pick的brachname的log
git log private/branchname - cherry pick
单个commit:
git cherry-pick <commitHash>多个commit:git cherry-pick <HashA> <HashB>[A,B):git cherry-pick A^..B
git submodule的使用
一些项目可能是放在同学自己的个人仓库上面的,可以使用submodule的形式进行链接。
- 添加submodule
- --name增加名字
git submodule add git://gitUrl path-to-submodule
- 移动submodule
- 下面命令能改变
.gitmodules每个submodule的path,submodule名字不会改变,可以手动改变git mv path-to-old-submodule path-to-new-submodule
- 删除submodule
- Delete the relevant section from the
.gitmodulesfile. - Stage the
.gitmoduleschanges:git add .gitmodules - Delete the relevant section from
.git/config. - Remove the submodule files from the working tree and index:
git rm --cached path_to_submodule(no trailing slash). - Remove the submodule's .git directory:
rm -rf .git/modules/path_to_submodule - Commit the changes:
git commit -m "Removed submodule <name>" - Delete the now untracked submodule files:
rm -rf path_to_submodule
- 克隆使用含有submodule的项目 包含对应的空目录需要使用以下两个命令
git submodule initgit submodule update
对外使用
Fork,Issues and PR are welcom. MIT License.
Why template branch includes homework?
Why template branch includes homework?
A big :bug: ,fixed!
We should unify code style, for examlpe google-cpp-style, google-python-style.