使用Eclipse上傳/下載Git項目

來源:互聯網
上載者:User

使用Eclipse上傳/下載Git項目

前提:

  • Eclipse已安裝EGit外掛程式
  • 已擁有GitLab/GitHub帳號
SSH方式配置SSH授權
  1. 本地產生授權Key
    Eclipse,選擇菜單: Window > Preferences > General > Network Connections > SSH2 > Key Management > Generate RSA key.. > Apply > Save Private Key..
  2. 遠程託管配置本地授權的Public Key
    進入GitLab管理首頁,Profile Settings > SSH keys
    Key 中輸入剛才產生的Public Key
上傳項目Commit至本地Git倉庫
  1. 建立本地Git倉庫
    右鍵工程,選擇菜單: Team > Share Project > Git
    Configure Git Repository對話方塊中,依次選擇: Use or create repository in parent folder of project > 勾選Project列表 > Create Repository > Finish
  2. Commit至本地Git倉庫
    右鍵工程,選擇菜單:Team > Commit
    Commit Changes對話方塊中,Commit message填:初始匯入;勾選Files列表中要提交的檔案。
    點擊commit進行提交
Push至遠程Git倉庫
  1. 建立Git遠程託管項目
    在GitLab管理首頁依次選擇: Projects > New Project
    Project path 填項目名稱,然後選擇Create project
    建立成功,會顯示項目相關資訊及Push方法。其中有SSH串連,如:git@gitlab.com:user/project.git
  2. Push至遠程Git倉庫
    右鍵工程,選擇菜單: Team > Push Branch 'master'.. (或Team > Remote > Push..)
    Push Branch master對話方塊中,Location > URI填寫1. 建立Git遠程託管項目得到的SSH串連:git@gitlab.com:user/project.git
    點擊Next > Next > Finish
    開始Pushing to remote repositories,等待上傳
    點擊OK完成
下載項目
  • Eclipse,選擇菜單: File > Import.. > Git > Projects from Git > Clone URI
    Import Projects from Git對話方塊中,Location > URI填寫Git託管項目的SSH串連:git@gitlab.com:user/project.git,點擊Next
  • 分支選擇:選擇master,點擊Next
  • 配置本機存放區路徑:選好儲存目錄,點擊Next
  • 選擇一個用來匯入項目的嚮導:選擇Import existing Eclipse projects,點擊Next
  • 匯入項目:從Projects列表中選擇要匯入的項目,點擊Finish

Git 教程系列文章: 

GitHub 使用教程圖文詳解   

Git 標籤管理詳解  

Git 分支管理詳解  

Git 遠程倉庫詳解  

Git 本地倉庫(Repository)詳解  

Git 伺服器搭建與用戶端安裝   

Git 概述  

分享實用的GitHub 使用教程  

Ubuntu下Git伺服器的搭建與使用指南 

Git 的詳細介紹:請點這裡
Git 的:請點這裡

本文永久更新連結地址:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.