Skip to content

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

@IcePigZDB

Description

@IcePigZDB

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 git@github.com: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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    adviceadvice for trainning planquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions