1. 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]

Discussion in 'Off Topic' started by TheBigK, Feb 12, 2015.

  1. TheBigK

    TheBigK Well-Known Member

    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?
    Marcus likes this.
  2. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    I use git to backup my whole xenforo working directory along with the database on my private repository..
  3. TheBigK

    TheBigK Well-Known Member

    Isn't it paid? Or free?

    Is it okay to backup entire XF code on github?
  4. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    Not specifically github, I've set up my own private server with GitLab
  5. TheBigK

    TheBigK Well-Known Member

    See : Private repository requires me to pay -

    Screen Shot 2015-02-12 at 2.29.40 pm.png
  6. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    You can use GitLab or BitBucket that supports private repos for free users...
  7. EQnoble

    EQnoble Well-Known Member

    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: Feb 12, 2015
    TheBigK likes this.
  8. Liam W

    Liam W Well-Known Member

    When I moved from my laptop to my MacBook, I created my own git server on a VPS of mine & used that.

  9. RastaLulz

    RastaLulz Well-Known Member

    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.
  10. OperaManiac

    OperaManiac Well-Known Member

    Use BitTorrent Sync. Offers exactly what you need.
  11. tyteen4a03

    tyteen4a03 Well-Known Member

    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.
    Jeremy P likes this.
  12. RastaLulz

    RastaLulz Well-Known Member

    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.
    Luke F likes this.
  13. Chris D

    Chris D XenForo Developer Staff Member

    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.
    tyteen4a03 and NixFifty like this.
  14. CLWoW

    CLWoW Member

    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.
  15. tyteen4a03

    tyteen4a03 Well-Known Member

    If you need to push the changes to the repo for your other computer, this makes the tree quite messy.
  16. CLWoW

    CLWoW Member

    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.

Share This Page