![]() ![]() ![]() From PC1: It checks to see if any uncommitted changes are on PC1.Here's the process this script uses (ie: what it's actually doing) It backs it up first instead! Read more below for how that works. It's safe too, because it doesn't overwrite or delete anything that is uncommitted. That's it! About 30 seconds later everything will be magically synced from PC1 to PC2, and it will be printing output the whole time to tell you what it's doing and where it's doing it on your disk and on which computer. Now cd into any directory within the git repo on PC1, and run: sync_git_repo_from_pc1_to_pc2 Here's some helpful links:Įnsure your ssh keys are all set up to ssh from PC1 to PC2. Git clone your repo you want to sync on both PC1 and PC2.Įnsure your ssh keys are all set up to be able to push and pull to the remote repo from both PC1 and PC2. 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. Update: see also this alternative/competitor: GitSync:.Readme: README_git-sync_repo_from_pc1_to_pc2.md.The script I wrote to do this is sync_git_repo_from_pc1_to_pc2.sh.How to edit in Eclipse locally, but use a git-based script I wrote ( sync_git_repo_from_pc1_to_pc2.sh) to synchronize and build remotely A remote project with Eclipse via SSH is now created. With the SSH connection set-up correctly passwords can be made an optional part of the normal SSH authentication process. If done correctly, there should now be a new remote project accessible from the Project Explorer and other perspectives within eclipse. Once connected, drill down into the host's Sftp Files, choose a folder and select Create Remote Project from the item's context menu.Enter the connection information then choose Finish.Define a new connection and choose SSH Only from the Select Remote System Type screen in the New Connection dialog.To create an SSH remote project from the RSE perspective in Eclipse: and choose Remote System Explorer from the Open Perspective dialog to open the RSE perspective. To check in Eclipse Indigo go to Window > Open Perspective > Other. ![]() RSE may already be included in your current Eclipse installation. It's a set of plug-ins to do exactly what you want. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |