![]() PC2_SSH_HOST="my_hostname" # explicitly type this out don't use variables PC2_SSH_USERNAME="my_username" # explicitly type this out don't use variables ![]() PC2_GIT_REPO_TARGET_DIR="/home/gabriel/dev/eRCaGuy_dotfiles" # explicitly type this out don't use variables # explicit instead just avoids this problem. # happen on the local machine when what we need is the variable expansion from the remote machine. This is because the variable expansion will # - Do NOT use variables such as `$HOME`. # and you must have *already `git clone`d* a copy of your git repo into it! Here are the parameters it contains: # The git repo root directory on PC2 where you are syncing your files TO this dir must *already exist* Now edit the "~/.sync_git_repo" file you just copied above, and update its parameters to fit your case. Install the script on PC1 (this solution assumes ~/bin is in your $PATH): git clone It is far far far faster than rsync, more trustworthy in my opinion because each PC maintains a functional git repo, and uses far less bandwidth to do the whole sync, so it's easily doable over a cell phone hot spot without using tons of your data. So far it works very well and I'm very pleased with it. I wrote a bash script to automate the process by using git to automatically push changes from PC1 to PC2 via a remote repository, such as github. So, how do I do it? What workflow should I use? If you have this question too, here's the workflow that I decided upon. I tried rsync, but it was insanely slow for large repos and took tons of bandwidth and data. I need a tool to easily synchronize from PC1 to PC2. Let's call the first computer where I write the code "PC1" (Personal Computer 1), and the 2nd computer where I build the code "PC2". build that code via ssh on a different, more powerful Linux computer (from the command-line, NOT from inside Eclipse).develop code using a powerful IDE like Eclipse on a light-weight Linux computer, then.This doesn't directly answer the OP's question, but it is so close I guarantee it will answer many other peoples' question who land on this page (mine included, actually, as I came here first before writing my own solution), so I'm posting it here anyway. ![]() It is simply a wrapper around git, however, so feel free to take it and convert it into a cross-platform Python solution or something if you wish This answer currently only applies to using two Linux computers (syncing from one to the other) because I wrote this synchronization script in bash.
0 Comments
Leave a Reply. |