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 ?
Now let’s start to see how to sync files between computers without cloud. Solution 1. Share files over the network Solution 2. Easier way to keep files in sync between computers Solution 1. Share files over the network Windows offers a sharing feature that allows anyone in the same network to access the shared folders.
Let’s see how to sync files over the network. Step 1: Find the file you want to share, then right-click the file and choose Properties. Step 2: Click the Sharing tab and then choose the Advanced Sharing... option. Step 3: Check the Share this folder and click Permissions to set the share permissions.
Tip: If want to sync folders of the drive on another computer, you can choose Remote to manage the computer and these computers must be on the same LAN. Go to the Sync page and click it in the toolbar. Specify the source and destination for files sync. Go to the Source section.
There is a free file sync tool for you. MiniTool ShadowMaker is a professional file sync software, which allows you to sync your files among multiple computers. In addition, MiniTool ShadowMaker also allows you to back up and restore files &folders and system you need.
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:
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.
Just Use rsync
command. Make sure you are in your local repo root path, and run:
rsync -a --exclude=.git . [email protected]:[Your Remote Path]
you can fix your code in local, and rsync it. When the code can be deploy, then commit the deploy issue.
you can config your ssh remote alias in ~/.ssh/config
file, google to know how to config it. Then your command will be:
rsync -a --exclude=.git . [remote-alias-name]:[Your Remote Path]
And needn't enter password.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With