同步文件没有提交? [英] sync files without commiting?

查看:107
本文介绍了同步文件没有提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我正在开发的项目,它的设置如下:一台服务器,一台台式机和一台笔记本电脑。我工作我的项目有时在桌面上,有时在我的笔记本电脑上。



如何在桌面PC和笔记本电脑之间同步我的文件而无需更改服务器? p>

谢谢

解决方案

您可以或多或少直接在您客户,即PC和笔记本电脑。传输可能是直接连接,如SSH或HTTP。但您也可以在外部媒体上使用另一个存储库,这可能是一个USB存储棒,一个外部硬盘驱动器,或者一个像Dropbox这样的服务。

这样您的工作流可以看起来像像这样:
$ b


  1. 在您的笔记本电脑上进行更改

  2. 在您的笔记本电脑上提交更改
  3. >
  4. 将提交推送到USB存储库

  5. 将提交从USB存储提取到您计算机上的存储库

  6. 进行更多更改

  7. 提交它们 - 如果您希望更改为原子级,您也可以修改其他提交

  8. 将最终提交推送到存储库在服务器上

请注意,在将它们推送到另一个存储库之前,您始终需要在本地提交更改。看起来你来自另一个像Subversion这样的SCM系统,其中提交总是意味着使更改在服务器和所有人上都可见。 Git工作不同,在你推送它们之前,提交只是本地的。


I have a project I'm working on and have the following set up : one server with my git repos, one desktop pc and a laptop.

I work on my project sometimes on the desktop, sometimes on my laptop.

How can I sync my files between the desktop pc and the laptop without commiting changes to the server ?

Thanks

解决方案

You can more or less directly pull and push between your "clients", i.e. PC and laptop. The transport may be a direct connection like SSH or HTTP. But you can also use another repository on external media, that may be a USB stick, an external hard drive or even a service like Dropbox.

That way your workflow could look like this:

  1. Make changes on your laptop
  2. Commit your changes on your laptop
  3. Push commits to repository on a USB stick
  4. Pull commit from the USB stick to the repository on your PC
  5. Make more changes
  6. Commit them - you might also amend your other commit if you want your changes to be atomic
  7. Push your final commits to the repository on the server

Be aware that you'll always need to commit your changes locally before you can push them to another repository. It seems like you come from another SCM system like Subversion where committing always means "make the changes visible on the server and for everyone". Git works different, commits are only local before you push them.

这篇关于同步文件没有提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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