How to add eclipse project to existing git repo?

前端 未结 1 1370
生来不讨喜
生来不讨喜 2021-01-14 01:25

I already have an existing project in Eclipse that I want to add to my team\'s github repo. The github repo is empty right now. What\'s the best way to add this project to o

相关标签:
1条回答
  • You have to add a remote to the project, and then push to it.

    For example, you can do (from inside the project directory)

    git init # if you haven't already
    git remote add origin ssh://git@github.com:.....
    git push -u origin master
    

    there should be a way to do that from the eclipse plugin too, but I find it easiear to do it from the command line.. :)

    By the way, remember to add all the IDE-specific files to .gitignore, to avoid pushing garbage to the world: they usually are .project, .classpath and directories like bin/*,.settings/* ...

    0 讨论(0)
提交回复
热议问题