如何从零创建gitee pull-request

如何创建gitee pull-request

更多关注
计算机视觉-Paper&Code - 知乎

前置条件

  • 仔细阅读contributing文档 https://gitee.com/ascend/modelzoo/blob/master/contrib/CONTRIBUTING.md
  • 提交CLA签名验证,https://clasign.osinfra.cn/sign/Z2l0ZWUlMkZhc2NlbmQ=
  • repo需要等待前一个模型pull-request已经合入后在操作下一个

流程步骤

  • 代码使用pep8规范 https://www.cnblogs.com/xiao-apple36/p/9242069.html
import os
def walkFile(file):
    for root, dirs, files in os.walk(file):
        for f in files:
            if f.endswith("py"):
                os.system(
                    "autopep8 --in-place --aggressive " + os.path.join(root, f))
                print(os.path.join(root, f))

walkFile(".")

  • c++代码使用google规范

File --> Preference --> setting --> 搜索 clang_format --> 在C_Cpp:Clang_format_fallback Style的输入窗中填入:
{ BasedOnStyle: Google, UseTab: Never, IndentWidth: 4, TabWidth: 4 }

# 安装批量format文件工具
https://marketplace.visualstudio.com/items?itemName=jbockle.jbockle-format-files
  • 注释一律使用英文
可以使用全局搜索替换,正则查询中文
(.[\u4E00-\u9FA5]+)|([\u4E00-\u9FA5]+.)
  • 配置repo公钥,使用 git remote set-url origin remote_git_address 修改remote

  • 进入modelzoo,并gitee页面上点击fork按钮

  • 克隆fork后的repo到本地

git clone https://gitee.com/wscjxky/modelzoo/
# 如果已经fork了,则需要与modelzoo主master进行同步
# 添加repo远程仓库地址到upstream
#git remote add upstream https://gitee.com//modelzoo.git
# 添加repo远程仓库地址到upstream
git remote add upstream  https://gitee.com//models
# 把repo更新到本地的upstream里
git fetch upstream
# merge远程最新的代码到本地
git merge upstream/master  --allow-unrelated-histories
# 提交本地改动到远程分支
git push

  • 将需要修改的代码替换掉原始Ascend modelzoo中的代码,并push到远程分支中
# 原始代码
# git clone -b r1.1  --depth 1 https://gitee.com/

git add .
git commit -m "1"
git push 
  • 进入当前用户的gitee modelzoo中,点击pull requests按钮并创建新的pr。
  • 需要标明合入的commit id以及被合入的commit id 可参考链接
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

子韵如初

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值