dsajkdadsa14222 2016-05-08 08:37
浏览 42
已采纳

打包:从fork提交PR时,如何避免“找不到包”错误?

I am running into what sounds like a limitation in an overall simple approach for integrating git with go install.

  1. I've forked a git repo on github
  2. I now have to deal with changing packages in the same repo to reference correctly my own fork.
  3. Then when I am ready to submit a PR, I need to revert the package imports while I won't be able to compile and install the changes.
  4. I could keep 2 repos and cherry pick the lines I need to change but that seems too complicated by 2016.

How do I get around this problem?

  • 写回答

1条回答 默认 最新

  • douxuanjie2692 2016-05-08 09:29
    关注

    You might have forked github.com/user1/goproject into github.com/user2/goproject, that does not mean you cannot clone it wherever you want in your GOPATH.

    In particular, you can clone it in:

    $GOPATH
      github.com
        user1
          goproject
    

    You effectively are replacing the local clone of the original repo by the clone of your fork.

    That means locally, you don't change any package path, even though git remote -v tells you are are pushing back to your fork url github.com/user2/goproject.

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

报告相同问题?

悬赏问题

  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据