开发者

How can I add current Eclipse project to git with EGit?

I have GAE project in开发者_如何学C my Eclipse and I want to add it to my local git repo, how can I do that?


Since creating a Git repo within a GAE project is possible through command line, it is possible through Egit:
Follow that Egit tutorial:

For a new repo:

Right click your project, select Team -> Share -> Git.
Select the proposed line and press "Create repository". Press finish

How can I add current Eclipse project to git with EGit?

Create the file ".gitignore" in your project with the following content.
All files / directories which apply to the pattern described in this file will be ignored

But you can also add it to an existing local repo by:

  • making a special branch for your project in your local repo (with just the .gitignore file in it)
  • clone it where your current project is
  • add all your current project files in it
  • import said Git repo into your workspace: See 4.2 Clone existing project.

informatik01 adds in the comment a link to a short article describing how to do it using the command line:
Adding Eclipse Project to Git

cd ~/workspace/my-project
git init .
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜