douke6027 2017-04-17 20:45
浏览 83
已采纳

提交拉取请求,以更改通过“ go get”安装的软件包

I have a package I installed via go get github.com/<other_user>/<repository>. It was missing some features, so I have been working with the original author to add them to the package.

I made the changes to my local copy and committed them. Then I realized: derp, I don't have authorization to git push these changes.

Is there a way for me to salvage my changes and somehow submit a pull request to him? Or do I have to lose all my changes, fork his repository, re-implement my changes, and then submit a pull request?

And no matter what I do, is there a way for me to retain the ability to do this command?

go get -u <original_repository>

Or do I have to just become a full-time contributor and continually update my fork with his repository?

  • 写回答

1条回答 默认 最新

  • duanfan8360 2017-04-17 20:47
    关注

    Fork the repo in GitHub, then add your fork as a remote in your working copy under a name other than origin, e.g. git remote add myfork git@github.org.... You can push your changes to your fork (git push myfork), then open a PR from your fork to the original.

    Explicitly, the commands would something like this after you fork the original to your own account:

    git remote add myfork https://github.com/<your_username>/<repository>.git
    git push myfork
    

    After which, you can submit the PR to the original. If your PR is accepted, you can then run these commands:

    git remote remove myfork
    git rebase master
    git pull origin master
    

    You can then delete your fork from your GitHub account. After which, go get -u will function as normal.

    Any time you need to make new changes to the package, you can repeat this process.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料