如何在不提交的情况下将本地服务器上的更改与远程服务器上的更改同步? [英] How to sync changes on my local server with the ones on the remote one without commiting?

查看:35
本文介绍了如何在不提交的情况下将本地服务器上的更改与远程服务器上的更改同步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一些软件,需要我使用远程服务器来测试它是否有效.我无法托管本地版本.

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.

无论如何,我已经设置了 git.我现在的工作方式是我将在基于 Windows 的笔记本电脑上本地更改某些内容,添加一个像Fix"这样的小型 git 提交,将其推送到远程存储库,然后在开发服务器(运行没有 GUI 的 linux)上获取它).

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 ).

我不想这样做,因为:

  • git 历史上充斥着无意义的小提交.

  • 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.

所以我想知道 - 我应该如何设置环境,以便本地笔记本电脑上的任何更改,即使不提交任何内容,也会立即更改开发服务器上的文件?有没有办法做到这一点?我什至可以跳过将它发送到远程 git 服务器,我只想在本地机器和开发服务器之间同步文件.

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.

最好的问候

推荐答案

分开是个好习惯:

  • 源代码管理(包括提交行为,在您的情况下,不应该在个小变化时发生)
  • 发布管理(打包和部署)

我什至可以跳过将它发送到远程 git 服务器,我只想在本地机器和开发服务器之间同步文件.

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.

这是一个发布管理过程,就像让一个 cron 作业做定期的 rsync.但这与您的 SCM(此处:Git)无关,它不会为此提供本机解决方案.

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屋!

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