[英]Workflow for creating new Maven project in Eclipse and bringing it to Github
我想在Eclipse中創建一個新的Maven項目,並將其推送到github上的新存儲庫。 我對實現這一目標的正確步驟有些困惑。
我發現了很多有關從github進行克隆的信息,但是我的github存儲庫還沒有Maven項目,因此無法導入Eclipse。 如果我改用命令行和空目錄,則因為目錄不為空,所以無法再應用Maven原型。
我很困惑。 有人可以使我困惑嗎?
git init
。 這將在該目錄中創建本地存儲庫。 $ git remote add origin https://github.com/user/repo.git
(可選地,將origin
替換為將要調用的遠程存儲庫的名稱,也將user
替換為github用戶名和repo
作為您的github存儲庫名稱的名稱) 例如
$ git add .
# Adds the file to your local repository and stages it for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'.
例如:
$ git commit -m "Add existing file"
# Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.
請注意,以以下結構為參考,我建議的是將project1
, project2
, projectN
任何目錄(而不是整個worspace( /roo_dir/workspace/
目錄))作為git存儲庫。
/roo_dir/workspace/
- project1
- project2
- projectN
其他讀物:
嘗試這個
最后,我執行了以下操作:
工作流程通常是@lealceldeiro建議的工作流程,但不使用命令行git。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.