Question

I would like to clone a Laravel 4 from Git HERE and after using a Composer to install all dependencies, I wish to create a new Git on my HDD where I have my Dropbox synchronized.

Is it even possible ?

After getting Laravel 4 being cloned into C:/www/laravel-project/, I would like to commit the whole project into my localhost REPO seating in D:/Dropbox/REPOS/Git/ so it will become D:/Dropbox/REPOS/Git/laravel-project/

Thanks

Was it helpful?

Solution

Two possible fixes:

  1. Edit .git/config so that your origin is your repo (replace https://github.com/laravel/laravel.git with file:///D:/Dropbox/REPOS/Git/laravel-project/).

  2. Delete the .git directory and then run git init and git remote add file:///D:/Dropbox/REPOS/Git/laravel-project/ origin

The problem I've seen with local directory repos is that the D:/Dropbox/REPOS/Git/laravel-project/ repo will need to be on a branch that will not be used (i.e. A DoNotUse branch).

OTHER TIPS

There are two paths you can take to do this:

  1. Change the origin to your "remote" and remove or rename the Laravel origin.
  2. Preserve the Laravel origin and use a second "remote" for your files.

Option 1 is probably the easiest.

  1. Go to D:/Dropbox/REPOS/Git/laravel-project/ and do git init to make an empty git repo.
  2. Go to your C:/www/laraval-project/ folder and do git remote -v and save the URL for the current origin if you want to keep it.
  3. Run the command git remote origin set-url file:///D:/Dropbox/REPOS/Git/laravel-project
  4. Optional: run git remote add github url-you-saved-from-step-2 so you can do git pull github if you want to update from the Laravel github
  5. Run git push -u origin master and it should push into your Dropbox's git repo.

For Option 2 you just skip steps 2 through 4 and - run git remote add dropbox file:///whatever and change step 5 to git push -u dropbox master or whatever branch you want. Once you use -u once you can just do git push and it should push to whatever you set as your upstream with -u.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top