美文网首页
github 提交代码流程

github 提交代码流程

作者: 5C6C | 来源:发表于2024-05-06 15:11 被阅读0次

    参考文章:https://www.sulinehk.com/post/how-to-use-github-flow-to-contribute-code-to-open-source-projects/

    https://github.com/PaddlePaddle/Paddle上,点击fork, 然后在自己的目录下面就有一个工程https://github.com/taixiurong/Paddle

    然后在本地用命令:git clonehttps://github.com/taixiurong/Paddle把代码clone到本地。

    然后git checkout branch dev,创建分子,然后修改代码。

    修改完代码后,git add XXX, git commit -m "xxxx"

    这个时候不要着急去push。先把远程paddle的代码更新到本地

    用git remote -vv 可以查看本地的url的信息。

    先git checkout develop分支

    然后执行命令 git remote add upstreamhttps://github.com/PaddlePaddle/Paddle.git

    然后 git pull --rebase upstream develop:develop 把远程分支develop同步到本地develop的分支。

    git checkout dev

    git rebase develop

    git push origin dev_local:dev_origin (第一个是本地分支,第二个是远程分支)

    然后登陆github。打开分支dev.

    就可以看到

    点击 pull request , 然后view pull request, 然后填写信息,就可以提交了。

    提交后,到https://github.com/PaddlePaddle/Paddle, 然后点击pull request,就可以看到自己提交的信息。修改一下PR types, PR changes Describe

    按照这个格式填写,然后就可以了。

    gitcherry-pick 的时候,先把develop分支,用git log --author taixiurong --grep xpu, 查看下, 都提交了哪些东西,把commit_id记录下来,然后拉一下远程的分支到本地,然后用

    git cherry-pick + commit_id, 提交到,解决冲突,提交到,重复上面的提交过程。

    需要依赖paddle的某个提交,但是这个提交还没有合入 可以参考https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

    git fetch origin pull/undefined/head:BRANCHNAME  # undefined 是pr的id. BRANCHNAME 是你要新分支的名字

    git checkout BRANCHNAME

    相关文章

      网友评论

          本文标题:github 提交代码流程

          本文链接:https://www.haomeiwen.com/subject/eyhsydtx.html