在github上參與開源項目貢獻代碼

來源:互聯網
上載者:User

標籤:des   http   使用   os   for   art   ar   cti   

1 登入github, 點擊自己感興趣的repository的fork按鈕,這樣自己的github首頁會有一個拷貝。

2 在自己本地修改同時保持和原來的repository同步:

git remote -v, 看看自己當前git repository的configure, origin 表示自己的repository

要添加一個新的遠程倉庫,可以指定一個簡單的名字,以便將來引用,運行 git remote add [shortname] [url]:git remote add upstream +原來repository的ssh連結

git remote -v, 可以看自己目前的目錄有哪些遠程倉庫。 此時應該加上了upstream repository,也就是你所fork的repository。

現在可以用字串upstream 指代對應的倉庫地址了。比如說,要抓取所有原來repository有的,但本地倉庫沒有的資訊,可以運行 git fetch upstream:這樣就把原來的repository的master branch拷貝到了本地。也可以用git fetch upstream branch1 把原來repository的branch1拷貝到本地。

使用git merge upstream/master 將upstream和自己的master合并。

用fetch不會影響自己本地的repository。用pull則相當於fetch了之後自動merge,可能會衝掉自己的代碼。

 

clone到本地進行修改,git add,commit,push。

進入自己的github首頁,點擊最上面綠色的compare&review按鈕。

寫點comment,提交。

 

ref:

https://guides.github.com/activities/forking/index.html

在自己本地修改同時保持和原來的repository同步。

https://help.github.com/articles/syncing-a-fork

3.2分支管理很有用,整本書的翻譯都有

http://git-scm.com/book/zh

 

聯繫我們

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