<p>Let me preface this by stating that I'm a complete noob when it comes to using git.</p>
<p>I have a repo that I worked on GitHub and then cloned on my PC. The project has many packages and most of them import some package from somewhere else in the tree. I rewrote the imports to reference my own namespace.</p>
<p>Now that I'm done testing my changes, I'm ready to push back to GH and submit a pull request, but I'd have to rewrite all those imports back to the way they were. This seems very cumbersome and I'm wondering if there's a better way to do it.</p>
<hr/>**评论:**<br/><br/>dgryski: <pre><p>Follow the instructions at
<a href="https://splice.com/blog/contributing-open-source-git-repositories-go/">https://splice.com/blog/contributing-open-source-git-repositories-go/</a>
or
<a href="http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html">http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html</a></p></pre>mrfrobozz: <pre><p>Excellent! Thank you. That cleared it all up for me.</p></pre>peterbourgon: <pre><p>Don't rewrite imports, use git remotes to work with your fork in the original repo's path on disk.</p>
<pre><code>cd src/github.com/original/project
git remote add mrfrobozz git@github.com:mrfrobozz/project
git fetch mrfrobozz
git checkout mrfrobozz master
</code></pre></pre>mrfrobozz: <pre><p>Oh that's interesting. And a bit backwards from how the GitHub docs walked me through it, but it makes a lot of sense. Then when I push, I'd do a </p>
<pre><code>git push mrfrobozz master
</code></pre>
<p>Right?</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传