简体   繁体   中英

Correct way to set up Github repo in Pydev?

What is the correct way to set up a Github located repository of a Pydev project?

I usually do:

  • create Pydev project
  • share Pydev project to local folder
  • create empty project on Github
  • Push to Github (with EGit)

The issues I encounter are:

  • Why is the project in some Git directory now, instead of my Eclipse Workspace now?
  • Why do I get double nested directory structure like: Git\\Project , Git\\Project\\.git , Git\\Project\\Project\\.project ? Is this correct?
  • Should I check in the .project and .pydevproject file? If I don't, I get a mess when cloning on a new computer. If I do, I get complains about incorrect path configuration, when I check out to a new computer.
  • Also it remains a mystery to me how and when I manage to configure the remote being tracked, rather than specifying the destination every time again.
  • How can I correctly clone the repository to a new computer and use it as a Pydev project in Eclipse?

I would normally start a new project by importing from Github. ie First create an empty repository at Github and then in Eclipse do

File -> Import -> Git -> Projects from Git

Once this is complete use the New Projects wizard to define a new PyDev Project with your repo. You will then have a clone of the github repo and be able to commit changes to github.

The Project should now have the same name as the repository on github.

EDIT: You can check in the .pydev and .pydevproject files.

In order to check out this project on a new computer you would follow these steps again - or export your eclipse environment and copy that to the new computer. For the sake of training yourself in eclipse and git it would probably be a good exercise to follow the above steps.

My project was already cloned for Git. To fix the issue I had to open the Git perspective and had my repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM