如何将本地服务器上的更改与远程服务器上的更改同步而无需提交? [英] How to sync changes on my local server with the ones on the remote one without commiting?
问题描述
我正在开发一些需要我使用远程服务器进行测试的软件。我无法托管本地版本。
无论如何,我已经设置了git。我现在的工作方式是在基于Windows的笔记本电脑上本地修改某些内容,添加一个像修复这样的小型git提交,将其推送到远程存储库,然后在开发服务器上获取它(运行不带GUI的Linux )。
我不想这样做: git的历史充满了无意义的小提交。 必须创建comits,将它们推送到远程仓库
,然后从开发者服务器获取它们。
所以我想知道 - 我应该如何设置环境在我的本地笔记本电脑上更改,即使没有任何提交,使开发服务器上的文件立即改变?有没有办法做到这一点?我甚至可以跳过将它发送到远程git服务器,我只想在本地机器和开发服务器之间同步文件。
最好的问候
这是一个很好的做法来分开:
我甚至可以跳过将它发送到远程git服务器,我只想在本地计算机之间同步文件和开发服务器。
这是一个发布管理过程,就像有一个定期执行rsync的cron作业一样。但它与你的SCM(这里:Git)没有任何关系,它不会有一个原生的解决方案。
I'm developing some software that requires me to use a remote server for testing if it works. I can't host a local version.
Anyway, I have git set up. The way I work right now is I will change something locally on my Windows-based laptop, add a small git commit like "Fix", push it to the remote repository and then fetch it on the development server ( which runs a linux without GUI ).
I don't want to do that becase:
The git history is littered with small pointless commits.
It's tedious to have to create comits, push them to the remote repo and then fetch them from the developer server.
So I'm wondering - how should I set up the environment so that any change on my local laptop, even without commiting anything, make the files on the development server change instantly? Is there a way to do it? I can even skip sending it to the remote git server, I just want to sync files between my local machine and the development server.
Best regards
It is a good practice to separate:
- source code management (including the act of committing, which, in your case, should not happen at every little change)
- release management (packaging and deployment)
I can even skip sending it to the remote git server, I just want to sync files between my local machine and the development server.
That is a release management process, like having a cron job doing regular rsync. But it has nothing to do with your SCM (here: Git), which won't have a native solution for that.
这篇关于如何将本地服务器上的更改与远程服务器上的更改同步而无需提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!