Github-提交PR指南

1. Fork你将要提交PR的repo

2. 将你fork下来的repo克隆到你的本地

git clone your_repo.git
Cloning into 'ultralytics'...
remote: Enumerating objects: 8834, done.
remote: Counting objects: 100% (177/177), done.
remote: Compressing objects: 100% (112/112), done.
remote: Total 8834 (delta 91), reused 126 (delta 65), pack-reused 8657
Receiving objects: 100% (8834/8834), 4.78 MiB | 49.00 KiB/s, done.
Resolving deltas: 100% (5859/5859), done.

3. 对本地代码进行修改

4. 创建分支,以你更新的主题为名

cd ./your_repo
git branch your_branch_name
git checkout your_branch_name

这么做是为了清晰明了,而不会是'your_repo/main'->'main_repo/main'这种容易混淆的PR形式.

5. 合并主仓更新

在你修改代码的时候,可能主仓已经进行了别的更新,合并了其他开发者的分支,所以在提交之前,需要再拉一次主仓代码防止冲突

git stash
git pull
git stash pop
git commit -am "ORT-CPP add the example table"
git push -f

(base) PS E:\project\Project_C++\ultralytics> git stash
Saved working directory and index state WIP on ORT-CPP: 51d4d69 Merge branch 'main' into ORT-CPP
(base) PS E:\project\Project_C++\ultralytics> git pull
Already up to date.
(base) PS E:\project\Project_C++\ultralytics> git stash pop
On branch ORT-CPP
Your branch is up to date with 'origin/ORT-CPP'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   examples/README.md

no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (624d556c338c43ad4f515a32595783f5ae3cf443)
(base) PS E:\project\Project_C++\ultralytics> git commit -am "ORT-CPP add the example table"
[ORT-CPP 131a8f9] ORT-CPP add the example table
 1 file changed, 1 insertion(+)
(base) PS E:\project\Project_C++\ultralytics> git push --set-upstream origin delete-unused-link
error: src refspec delete-unused-link does not match any
error: failed to push some refs to 'https://github.com/DennisJcy/ultralytics.git'
(base) PS E:\project\Project_C++\ultralytics> git push -f
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcm/tlsverify for more information.
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcm/tlsverify for more information.
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 12 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 461 bytes | 461.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To https://github.com/DennisJcy/ultralytics.git
   51d4d69..131a8f9  ORT-CPP -> ORT-CPP

6. 创建PR

进入你的Github主页,首先进入你fork下来的仓库

https://github.com/your_name/your_repo

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值