1

I made a home server where i'm using Git on a website I'm doing. I created a git on that home server, but I'm editing the files from another computer remotely connecting to it, and using an IDE(Eclipse+Egit) I'm using it. but its kinda slow.

So is there a way to get my repository on my own system, but the actual working directory to the server?

Currently my server git is on

Z:/sites/my_site/.git

I want my git to be on:

C:/git/my_site/.git

but still work on the

Z:/sites/my_site/

files, and my local git seeing that.

I hope its clear what i am asking...

EDIT: The website is PHP based. and i dont WANT to install PHP on my computer, so i can test the code, thats the server's job. i created that server for testing. Ths why i wantto do it this way.

NaGeL182
  • 894
  • 1
  • 13
  • 35
  • 2
    Why don't you simply clone from your original Git repo to a local one, and do normal pushing? And I don't quite understand why you think putting the repo in local while having the working copy in remote can make everything faster... – Adrian Shum Feb 06 '13 at 07:29

3 Answers3

2

Git is distributed version control system. You can make any number of repositories you want and link them as remotes. Git supports file:// and ssh:// protocols, so you can use it via local network or true-remote servers. I think the best solution is to keep bare repository on your server and clone it anywhere you need.

Also, remember that you can use bitbuket for your projects. It supports unlimited number of private repositories for free for up to five persons.

madhead
  • 31,729
  • 16
  • 153
  • 201
1

Generally the right answer here is to have two git repositories, one on the remote machine and one on your local one, and simply push to the remote machine to deploy the code.

smw
  • 592
  • 4
  • 10
0

Git is a "distributed version control system", where every local repository holds everything (current state and all change history) locally. This way working locally is blazing fast, and you have no dependency on a remote repository like when you work with SVN for example. In light of that, I think what you did is exactly the opposite of what using Git is all about.

To use Git the way it's supposed to be used, you should clone from your central repository, and push updates to that repository. Your local repository can be in C:/git/my_site/.git, and when you're done making changes you push from that repository to the one on Z:.

Take a look at http://git-scm.com/ it has all you need to know to get started with Git "the right way".

TheZuck
  • 3,513
  • 2
  • 29
  • 36
  • i know II'm not using the right way, but the website is PHP based. and i dont WANT to install PHP on my computer, so i can test the code, thats the server's job. i created that server for testing. Ths why i wantto do it this way. – NaGeL182 Feb 06 '13 at 08:18
  • So if you want to edit files on your local server, but be able to test it on remote server, you have to mirror the code between both machines. either git or rsync can be used to mirror, but if you already work with git just follow the advice here and set up a remote repository on you local machine, pointing to the server, and push/pull between both to synchronize code – CharlesB Feb 06 '13 at 09:05