Eclipse Egit工具使用,上傳代碼到github

來源:互聯網
上載者:User

最近在學習使用版本管理工具,想在eclipse裡面同步代碼到github網站,github.com是一個免費的開原始程式碼控制網站,環境搭建:

win7+eclipse+gitbash,環境搭建google解決,參考:http://xleon.iteye.com/blog/1484884

大體注意: 需使用git bash進行命令列輸入,需擷取ssh key,並add到github網站帳號。

開始->git->右鍵以管理員身份開啟
git bash,以防後面有的地方需管理員權限。

然後可通過 ssh -vT git@github.com 檢查與github網站的串連狀況,如串連正常,會在倒數第5行出現, Hi *** You've successfully authenticated, but
GitHub does not provide shell access. 說明你串連成功了,帳號可正常使用。

然後就可以在github建立代碼倉庫repository,如建立HelloWorld,建好後可在files出找到該倉庫ssh地址,以後提交代碼就是這個地址了,其還包括其他的如https地址。

在本地工程目錄下,右鍵 git init here 後可在本地初始化git 工程,然後然後按照網上的方法配置git環境。包括使用者名稱,郵箱等。

出現錯誤:git updates were rejected because the tip of your current branch is behind 參考 http://www.linuxidc.com/Linux/2012-04/58985.htm

使用git push -f origin master 強推解決。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.