Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于training-plan后续发展与管理的讨论与记录 #29

Open
IcePigZDB opened this issue Jan 13, 2021 · 3 comments
Open

关于training-plan后续发展与管理的讨论与记录 #29

IcePigZDB opened this issue Jan 13, 2021 · 3 comments
Labels
advice advice for trainning plan question Further information is requested

Comments

@IcePigZDB
Copy link
Contributor

IcePigZDB commented Jan 13, 2021

General Question

关于新生学习计划training-plan后续发展与管理的讨论与记录,包括但不限于仓库版本纪要仓库组织框架作业规范重要管理命令对外使用,如果有需要优化的地方一起讨论:

仓库版本纪要

2019-07-06

仓库上线#11🚀

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拉取私仓

  1. github上新建一个私仓
  2. 添加公仓作为 public remote
    git remote add public [email protected]:CDDSCLab/training-plan.git
  3. 切到public/template
    git checkout public/template
  4. 将public/template push到新建的私仓上面

从私仓中cherry-pick做得好的PR

  1. 添加私仓作为remote
    git remote add private git://gitUrl
  2. 拉取不合并
    git fetch private
  3. 查看想要pick的brachname的log
    git log private/branchname
  4. cherry pick
    单个commit:git cherry-pick <commitHash>
    多个commit:git cherry-pick <HashA> <HashB>
    [A,B): git cherry-pick A^..B

git submodule的使用

一些项目可能是放在同学自己的个人仓库上面的,可以使用submodule的形式进行链接。

  • 添加submodule
  1. --name增加名字
    git submodule add git://gitUrl path-to-submodule
  • 移动submodule
  1. 下面命令能改变.gitmodules每个submodule的path,submodule名字不会改变,可以手动改变
    git mv path-to-old-submodule path-to-new-submodule
  • 删除submodule
  1. Delete the relevant section from the .gitmodules file.
  2. Stage the .gitmodules changes:
    git add .gitmodules
  3. Delete the relevant section from .git/config.
  4. Remove the submodule files from the working tree and index:
    git rm --cached path_to_submodule(no trailing slash).
  5. Remove the submodule's .git directory:
    rm -rf .git/modules/path_to_submodule
  6. Commit the changes:
    git commit -m "Removed submodule <name>"
  7. Delete the now untracked submodule files:
    rm -rf path_to_submodule
  • 克隆使用含有submodule的项目
    包含对应的空目录需要使用以下两个命令
  1. git submodule init
  2. git submodule update

对外使用

Fork,Issues and PR are welcom.
MIT License.

@IcePigZDB IcePigZDB added question Further information is requested advice advice for trainning plan labels Jan 13, 2021
@ehds
Copy link
Member

ehds commented Jan 14, 2021

Why template branch includes homework?

@IcePigZDB
Copy link
Contributor Author

Why template branch includes homework?

A big 🐛 ,fixed!

@IcePigZDB IcePigZDB assigned IcePigZDB and unassigned IcePigZDB Jan 14, 2021
@ehds
Copy link
Member

ehds commented Jan 14, 2021

We should unify code style, for examlpe google-cpp-style, google-python-style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advice advice for trainning plan question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants