Eclipse提交專案到GitHub上
說明:高版本eclipse開發工具自帶Git外掛(免安裝)
- 檢視eclipse是否已安裝git外掛
window->preferences
檢視是否有git配置項;
不存在請安裝後操作哦! 上傳本地工程
右擊”專案名稱”->Team->share project… ->select a repository type:Git,如下圖所示
建立本地倉庫
3.1 Creation of repositories in the Eclipse workspace is not recommended
警告:不建議在Eclipse工作區中建立儲存庫
3.2 點選create按鈕,我們自己建立一個.git檔案倉庫
3.3 勾選要上傳的工程專案如下圖
Path winth repository 為倉庫內檔案,建議創業一個本專案的父級檔案,便於後期管理整潔!
點選完成功能按鈕,本地倉庫建立成功。
3.4 此時回到工程,專案會如下所示,檔案前面會出現‘?’字樣,代表著要被提交哦
上傳工程程式碼到本地倉庫
右鍵”專案名稱”->Team->Commit (Ctrl+#)
說明:Author:使用者名稱 <郵箱>(提交者的使用者名稱和郵箱)
Committer: 使用者名稱 <郵箱>
commmit 完成本地倉庫上傳操作!上傳工程程式碼到遠端github倉庫
輸入目的地倉庫位置Enter the location of the destination repository.
5.1 Location位置
URI:遠端倉庫路徑
Host:github.com:根據自動填入
Repository path:根據uri自動填入
5.2 Connecton連線
Protocal:選擇傳輸協議為https
Port:不用填
5.3 Authenticaton認證
User:遠端倉庫使用者名稱
Password:遠端倉庫密碼
Store in Secure Store 儲存密碼
配置push規則
6.1 選擇 source ref:refs/heads/master
6.2 點選+Add Spec
6.3 在Specifications for push
勾選Force Update(強制更新到github倉庫中)
finish推送結果 push result
登入github檢視
恭喜,完成!