1

I'm developing a web application using Laravel 4, it's pretty big and i'm still developing it, the problem here is that i'm developing it on my Mac, but another web designer want to edit the views files and start working asynchronously, we have a hosting server and i have access to it with SSH, git already installed there, what i really want to do is, clone my local project into the remote server through Git, and start committing changes onto the server through PhpStorm 7. Can you please guys give me steps that i can follow to clone my local project to remote server and how to SAVE CHANGES on the files on the server !

Iliyass Hamza
  • 1,355
  • 3
  • 15
  • 28
  • possible duplicate of [Laravel 4 and the way to deploy app using FTP](http://stackoverflow.com/questions/22023048/laravel-4-and-the-way-to-deploy-app-using-ftp) – Rosmarine Popcorn Oct 21 '14 at 17:03

2 Answers2

0

A great way to do this is http://github.com; start an account and use the "private" feature if it isn't a public project. They explain it all very well, but here's a link to the "Create a Repo" page: https://help.github.com/articles/create-a-repo/.

If you aren't interested in using git, it's still pretty easy, but not quite as much:

- cd /path/to/your/<future-repo>
- git init 
- git add .
- git commit
- cd .. && git clone --bare <future-repo> repo.git # repo.git is whatever you choose
- scp -r repo.git user@server:/path/to/repo.git
- log onto server;
- cd /path/to/repo.git
- chmod 775 find . -type d (so group will have permissions, if needed)
- git repo-config core.sharedRepository true

Then you each can clone it:

- git clone user@server:/path/to/repo.git ./repo

OR

- it clone ssh://USERNAME@SERVER.com:~/repo.git ./repo
Hans
  • 3,403
  • 3
  • 28
  • 33
0

What I do is all built into my editor. I maintain my app with version control, but it is much easier to just have a synced local copy and then open the project locally so it can be indexed with your editor like Atom, PhpStorm, or Sublime Text. Then in most of these editors you can easily just use a remote sftp style syncing tool. If you are on a shared host you might have to use a syslink to make sure public is forwarded to -> public_html, but that is about all you need to do.

I like to work locally and test on a VM with port forwarding that is identical to my server and then push to the server itself within my editor. This method works really well. You just need to make sure you ignore your .env file and possibly any other files that reference the site URL if you have for example style tags in your HTML markup, or blade app.blade.php file. And of course if you use git the .git file and other non-production based files, but since it is outside of the web route it isn't as dangerous, but better safe then sorry.

  1. Atom - https://atom.io/packages/remote-sync
  2. PhpStorm - built in I believe
  3. Sublime Text - http://wbond.net/sublime_packages/sftp
Goddard
  • 2,863
  • 31
  • 37