如何在EGit中创建远程git存储库并将其链接到现有的Eclipse项目? [英] How do I create a remote git repository in EGit and link it to an existing Eclipse project?

查看:250
本文介绍了如何在EGit中创建远程git存储库并将其链接到现有的Eclipse项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Eclipse Helios和EGit。我是Git的新手。我有一个现有的Eclipse项目,用于Android应用程序,我想放在Git中。有人可以分享一些关于如何在共享文件夹上设置Git repo的说明,并将现有项目放在使用EGit的git repo中?我已经尝试过各种选项,没有成功。



谢谢!

解决方案



在项目的根目录中执行以下操作:

  git init 

在您所在的文件夹中执行相同操作想要你的祝福或中央资料库:

  git init --bare 

在本地存储库中,添加一个自述文件并提交:

  echotesting> readme 
git add readme
git commit -minitial commit

现在链接并将您的更改推送到中央存储库:

  git remote add origin // server / share / repodir 
git push -u origin master

希望这可以让你开始。



如果您喜欢,可以稍后使用egit,但是单独使用git没有任何问题。


I am using Eclipse Helios and EGit. I am new to Git. I have an existing Eclipse project for an Android app I would like to place in Git. Can someone please share some instructions on how to setup a Git repo on a shared folder, and place the existing project into this git repo using EGit? I have tried a variety of options with no success.

Thanks!

解决方案

You can do everything from the command line instead:

Do this in the root of the project:

git init

Do the same in the folder where you want your blessed or central repository:

git init --bare

In the local repository, add a readme file and commit it:

echo "testing" > readme
git add readme   
git commit -m "initial commit"

Now link and push your changes to the central repository:

git remote add origin //server/share/repodir
git push -u origin master

Hope this gets you started.

You can use egit later if you like, but there is nothing wrong with using git separately.

这篇关于如何在EGit中创建远程git存储库并将其链接到现有的Eclipse项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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