跨计算机快速同步git工作区 [英] Quickly sync'ing git workspace across computers

查看:104
本文介绍了跨计算机快速同步git工作区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用git的个人项目,我经常在多台计算机上进行攻击,并托管在Github上。由于我在家工作,我往往会经常被打断。我会在一个声明的中间,晚餐会准备好,否则我需要换尿布。当我回到编码时,我可能会在另一台计算机上。获得最新版本的最佳方式是什么?

我认为最正统的答案是承诺和推动。我经常犯下错误,但在这里犯下的错误似乎对我很混乱。代码可能处于完全破碎的状态,我正处于思考的中间。即使在主题分支上提交并发布它也不适合我。这也是比我更喜欢的步骤。



直到现在我一直在使用DropBox。但这似乎导致了我的腐败指数。不难想象,因为这些同步可以跨越不同版本的git和不同的操作系统。所以我很害怕这件事。



有没有人有更好的选择?

解决方案

使用Git在计算机之间保持代码库同步的另一种方法是将实际的代码库保留在您的保管箱中。本质上,它只是一个同步的本地文件夹,所以无论您在哪台计算机上(只要您保存了当前的工作),它都会同步给您。它节省了在Dropbox上推送到git仓库的步骤。


I have a personal project using git that I often hack on across multiple computers, hosted on Github. Since I work on this at home I tend to get interrupted fairly often. I'll be in the middle of a statement, and dinner will be ready or I need to change a diaper. And when I get back to coding I may be on a different computer. What's the best way to get the most up-to-date version?

I think the most orthodox answer would be to commit and push. I commit fairly often but committing here seems messy to me. The code may be in a completely broken state where I was in the middle of a thought. To commit and publish it, even on a topic branch, doesn't seem right to me. It's also more steps than I would prefer.

Until now I've been using DropBox. But this appears to have lead me to a corrupt index. It's not hard to imagine because those syncs can be across different versions of git and different operating systems. So I'm afraid this it out.

Does anyone have a better alternative?

解决方案

An alternative to using Git to keep a codebase in sync across computers is to keep the actual codebase on your dropbox. Essentially, it just a local folder that's synchronised, so that whatever computer you're on (as long as you have saved your current work) it will be synced for you. It saves the step of pushing and pulling to a git repo on dropbox.

这篇关于跨计算机快速同步git工作区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆