• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

phpStorm : How do I sync code between two computers? [n00b question]

TheBigK

Well-known member
#1
Maybe the answer is using gitHub! I start coding on my iMac and after writing few lines of code, want to switch to may Macbook. What's the best way to keep my code synched between two machines?

If the answer is using gitHub - what's the correct way to only share the code for addon and not accidentally expose all of xenforo code? Also, do I need to pay for having private space on gitHub?

-What are other alternatives?
 

EQnoble

Well-known member
#7
Isn't it paid? Or free?

Is it okay to backup entire XF code on github?
Not to throw the windows solution out there again for you TBK but it's what I use, but what I have done in the past is just made a network drive out of a directory and shared the drive with all computers behind my router. I am sure Mac has something similar if you are only using your own hardware locally. Since you have direct access for read and write that way, it doesn't really matter which machine holds the physical disk since it will be accessible.
 
Last edited:

RastaLulz

Well-known member
#9
If it's only you working on the project(s), use Dropbox! It'll automatically sync everything in your Dropbox folder across all your devices; it makes coding across multiple computers extremely convenient. You also get 2GB of space for free, so there's no reason not to try it.
 

tyteen4a03

Well-known member
#11
For code, please please please use a VCS such as Git. BT Sync and Dropbox are designed for files, not code. There is no revision control so you can't look back in history and see what happened, making debugging possibly a hassle.

BitBucket offers private repos.
 

RastaLulz

Well-known member
#12
For code, please please please use a VCS such as Git. BT Sync and Dropbox are designed for files, not code. There is no revision control so you can't look back in history and see what happened, making debugging possibly a hassle.

BitBucket offers private repos.
It doesn't really make much sense to constantly commit changes every time you switch between computers, as many times you're in the middle of something.

Also, using a service like BT Sync or Dropbox doesn't prohibit you from using Git.
 

Chris D

XenForo developer
Staff member
#13
PhpStorm has a cool utility to create patch files.

I would always recommend using a full VCS, but should you not want to do WIP commits to your repo, or you have other reasons, patches are quite convenient.

From one PC you choose to "Create Patch". Upload that to Dropbox or Google Drive or copy it to the other computer by some other means. Apply Patch and you're now working on your most up to date code.
 
#14
I would always recommend using a full VCS, but should you not want to do WIP commits to your repo, or you have other reasons, patches are quite convenient.
That's what I use develop branches for, and then merge it to master/trunk when it's time to move it to production. I'm at the point I wouldn't do a code project without a VCS be it SVN or Git or whatever you are comfortable with. I personally have GitLab setup on a DigitalOcean droplet, but bitbucket is also a great option as others have mentioned.
 

tyteen4a03

Well-known member
#15
That's what I use develop branches for, and then merge it to master/trunk when it's time to move it to production. I'm at the point I wouldn't do a code project without a VCS be it SVN or Git or whatever you are comfortable with. I personally have GitLab setup on a DigitalOcean droplet, but bitbucket is also a great option as others have mentioned.
If you need to push the changes to the repo for your other computer, this makes the tree quite messy.
 
#16
If you need to push the changes to the repo for your other computer, this makes the tree quite messy.
All depends on your develop pattern and work flow. I use this daily for my living for moving work between home and the office, as long as you commit your code and push it it's not that hard to do a pull from your remote. It should keep commits in order.