<p>I've got 3 computers and it'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'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'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'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'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't understand the "don't do that". Cause it'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't understand your problem. You find it frustating to keep the dependecies of a project in sync across multiple machines?</p>
<p>Isn'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'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'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're having the same issues I did when learning how go manages dependencies (tl; dr it doesn'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
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传