Gopath under Version Control

xuanbao · · 521 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;ve got 3 computers and it&#39;s quite frustrating to have on every computer the same files for me and have them at the same time under version control(checkout whole GOPATH with one command).</p> <p>Thats why I thought why not put all those little suckers(git repos) in the gopath into one single bucket, and have a simple mechanism to sync that whole bucket into one github repository and have the other computer simply pull down the new state of truth.</p> <p>Voila - a simple sync assuming i&#39;m syncing after im finished at one pc and going to the other. Assumption two ofc is that im working alone.</p> <p>Did anyone do this before?</p> <hr/>**评论:**<br/><br/>VivaceNaaris: <pre><p>Why would you sync the entire GOPATH? Just use VCS for your own projects, and use <code>go get...</code> to pull your dependencies.</p></pre>limdi: <pre><p>How do you manage syncing patches you made to your other machines?</p></pre>koalefant: <pre><p>I set my GOPATH to my Dropbox folder. Works well :)</p></pre>limdi: <pre><p>That&#39;s the most simple idea I heard so far, thank you!</p> <p>That would definitely take care of the syncing. However I find it exciting to try to store the gopath under version control to roll back incase I do something and it does not work anymore.</p></pre>koalefant: <pre><p>Don&#39;t store all the projects under your GOPATH in one version controlled repo. I work out of the my dropbox folder but each project under the $GOPATH/src/ directory has their own git repository. Once I am satisfied with local development, I push it up to bitbucket or github.</p> <p>The Dropbox thing has nothing to do with version control, it&#39;s just so I can treat my work computers as conceptually 1 local computer.</p> <p>edit: which also means if you stuff up your project locally, just delete the folder and pull from the remote repo back into your Dropbox synced GOPATH folder.</p></pre>limdi: <pre><p>I understand your solution, I don&#39;t understand the &#34;don&#39;t do that&#34;. Cause it&#39;s too complicated to have lots of git repos managed?</p> <p>Ah let me explain. This repo would hold all the other git repositories and their files.</p> <p>It would add commands like - cmd snapshot - cmd checkout - cmd status</p> <p>etc.</p></pre>kaeshiwaza: <pre><p>Why not keep Go and freedom for this ? <a href="https://syncthing.net/" rel="nofollow">https://syncthing.net/</a></p></pre>Orange_Tux: <pre><p>I don&#39;t understand your problem. You find it frustating to keep the dependecies of a project in sync across multiple machines?</p> <p>Isn&#39;t that where the <code>vendor</code> folder is for? </p></pre>limdi: <pre><p>Ah why the features, I believe syncing between machines and including version control over whole gopath should be and can be simpler than it is now.</p> <p>vendor doesn&#39;t help in this regard, sadly.</p></pre>anacrolix: <pre><p>I have an rsync script for this. </p></pre>fabstu: <pre><p>Do you mind sharing how you see and deal with conflicts? This is one pain point of mine.</p></pre>anacrolix: <pre><p>I only edit on one machine. If you&#39;re not, you should be using git, or sync to the others when you leave a machine. </p></pre>fabstu: <pre><p>Git for the whole Gopath?</p></pre>Smokey_Circles: <pre><p>How are you managing these repos?</p> <p>I keep the git repo in the gopath. Keeps things sane. Everything is under $GOPATH/src/my_repo/thing</p> <p>You can replace my_repo with github.com/your_user.</p> <p>I sense you&#39;re having the same issues I did when learning how go manages dependencies (tl; dr it doesn&#39;t)</p></pre>limdi: <pre><p>How do you manage moving your patches to go get-ed repos between your own machines?</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

521 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传