eclipse - 如何配置 git 服务器来共享项目

标签 eclipse git egit vmware-workstation

我目前在我的 win7 计算机上的虚拟机中安装了 Fedora 17。我想配置虚拟机来使用 git 管理我的项目。我在 win7 上使用 eclipse helios 和 egit 插件,我的项目当前驻留在本地。 Git 和所有依赖项已安装在 VM 上。 VM 的主机名是 dev.local 并且已经安装了 SSH,因此我将使用以下 URL 进行访问: ssh://[email protected] :/php/projects/myframework.git

我的问题是,如何在虚拟机上初始化新的 git 存储库,然后将本地项目推送到虚拟机中,以便由虚拟机中的 git 管理?

最佳答案

好吧,我终于明白了。我最终做的是在我的 VM(即我的 Git 服务器)上创建我的 git 目录:

# mkdir /home/brett/myproject.git && cd /home/brett/myproject.git

# git init --bare

在我的客户端上,在项目文件夹中 (C:\www\myproject):

# git init

# git add .

# git commit -m "Initial commit"

# git remote add origin ssh://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="731101160707331716055d1f1c10121f" rel="noreferrer noopener nofollow">[email protected]</a>/myproject.git

# git push origin master

我删除了项目的客户端副本,并在 Eclipse 中,文件 > 导入 > Git > 来自 Git 的项目,选择 URI。

我插入了详细信息以访问 dev.local 上的 git 存储库,并能够在 eclipse 中创建本地副本。

无论如何,感谢所有花时间回复此问题的人。我实际上在网上找到了一篇不错的文章,很有帮助。

http://www.vogella.com/articles/EGit/article.html

关于eclipse - 如何配置 git 服务器来共享项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11229837/

相关文章:

Fedora 16 上 Eclipse 中的 Android SDK 和 AVD Manager - 没有关闭窗口按钮

git - 什么是 gitbash 的好替代品?

git - BitBucket Git 错误 : did not send all necessary objects

git - 为什么 cherry pick 在提交未触及的行中显示冲突?

团队上的 Eclipse 'Unhandled loop exception' > 提交

eclipse - 为什么EGit有不同类型的 "Team"菜单?

eclipse - 如何在Eclipse中搜索光标下的字符串

java - 为什么 Eclipse 找不到 javax.servlet.ServletContextListener?

java - 尝试从 eclipse 加载 Android 1.6 虚拟设备时出错

git - 为什么 .git/refs/remotes 中的 git remote sill 的旧名称?