当前位置:   article > 正文

Github-提交PR指南_github怎么提pr

github怎么提pr

1. Fork你将要提交PR的repo

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

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

3. 对本地代码进行修改

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

  1. cd ./your_repo
  2. git branch your_branch_name
  3. git checkout your_branch_name

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

5. 合并主仓更新

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

  1. git stash
  2. git pull
  3. git stash pop
  4. git commit -am "ORT-CPP add the example table"
  5. 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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/613696
推荐阅读
相关标签
  

闽ICP备14008679号