Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
618 views
in Technique[技术] by (71.8m points)

git - How to sync changes on my local server with the ones on the remote one without commiting?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...