简体   繁体   中英

How do I import an existing non-git java project into a github repository?

I am currently trying to import a working Java Project which was provided by our professor into a private github repository to work on it in a group.

So far we've tried to copy files over manually, which caused problems when Eclipse did not consider the files part of the src package, and moving all files into the empty git repository and adding them manually.

When trying to add them manually, it gives the error message "The declared package "com.bar.foo" does not match the expected package "src.com.bar.foo"".

cd /java-project
git init
git remote add origin <git-url>
git add *
git commit -m "Initial Commit"
git push -u origin master

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