Git:不同的工作目录和存储库位置 [英] Git: Different Working Directory and Repository location

查看:330
本文介绍了Git:不同的工作目录和存储库位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个家庭服务器,我在我正在使用的网站上使用Git。
我在该家庭服务器上创建了一个git,但是我正在编辑远程连接到另一台计算机的文件,并使用我正在使用的IDE(Eclipse + Egit)。但它有点慢。



那么是否有一种方法可以在我自己的系统上获取我的存储库,但实际的工作目录到服务器?

目前我的服务器git在

$ p $ Z:/sites/my_site/.git

我想要我的git:

  C:/git/my_site/.git 

但仍在工作

  Z:/ sites / my_site / 

文件,以及我本地的git看到的。



我希望它清楚我在问什么...



编辑:该网站是基于PHP的。我不想在我的电脑上安装PHP,所以我可以测试代码,这是服务器的工作。我创建了该服务器进行测试。这就是为什么我想这样做。

Git是 distributed 版本控制系统。您可以创建任意数量的存储库并将它们作为远程连接。 Git支持 file:// ssh:// 协议,因此您可以通过本地网络或true-远程服务器。我认为最好的解决方案是保持裸露存储库,并将其克隆到您需要的任何地方。



另外,请记住,您可以使用 bitbuket 为您的项目。它支持无限数量的免费私人存储库,最多可容纳五人。


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.

解决方案

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.

这篇关于Git:不同的工作目录和存储库位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆