<p>So I am trying to do manual vendoring in 1.5. I did git clone under my vendor directory and the compiler was able to find the package. Great!</p>
<p>Now my question is, I want to commit the changes including the vendor folder. Should I include the .git of the vendored package or delete it and keep just the code + license?</p>
<hr/>**评论:**<br/><br/>HectorJ: <pre><p>Git submodules are the way to go IMO.</p>
<p>'go get' will now fetch them. </p>
<p>Shameless plug : I've been working on a tool to manage go1.5+ dependencies with the main objective of keeping packages "naturally" go-gettable with their pinpointed dependencies : <a href="https://github.com/hectorj/godm">https://github.com/hectorj/godm</a> </p></pre>rem7: <pre><p>I prefer using git subtrees and merging with --squash</p></pre>kylewolfe: <pre><p>Oh, nice! The issue for it is still open, so this slipped by without me noticing! (<a href="https://github.com/golang/go/issues/7764" rel="nofollow">https://github.com/golang/go/issues/7764</a>)</p></pre>peterbourgon: <pre><p>Strong -1. git submodules are broken by design; use subtrees, or copy manually.</p></pre>dlsniper: <pre><p>Sure, why not? It should be easier to upgrade them afterwards, no? And keep track of the differences between your version and the upstream version.</p></pre>reditter15: <pre><p>No.</p>
<p>Having dependencies inside the repository is a good practice (some people may not agree), but the .git folder should not be commit, just the code.</p>
<p>Godep does this for your in an automated way: <a href="https://github.com/tools/godep" rel="nofollow">https://github.com/tools/godep</a></p></pre>peterbourgon: <pre><p>This is probably the right answer.</p></pre>TheMerovius: <pre><p>If you include the .git, this will be converted to a git submodule automatically (I think) which is usually what you want.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传