2 回答

TA貢獻(xiàn)1852條經(jīng)驗(yàn) 獲得超1個(gè)贊
1. Fork別人的代碼repo
2. clone自己的fork到本地,進(jìn)行修改
在自己的Repositories里面找到剛才fork出來的Repo.
因?yàn)楫吘共皇窃髡?,要定期去update最新的代碼,所以最好不要直接提交到自己的master branch上,而是在github上單獨(dú)創(chuàng)建一個(gè)branch。
然后在右側(cè)找到SSH clone URL,在本地的命令行里面執(zhí)行
PS:
也可以直接在github上修改,然后頁面內(nèi)Commit。量不大時(shí),這樣做比較方便。只要網(wǎng)速給力……
3. 提交修改到github
[python] view plain copy print?
git commit -a
git push
4. 創(chuàng)建pull request 讓作者codereview
點(diǎn)擊Pull Requests -> New pull request
點(diǎn)擊Edit
左側(cè)選取作者的master branch (一般是這樣,除非有單獨(dú)的branch給開發(fā)用),右側(cè)選自己的repo的新branch
再點(diǎn)擊 Click to create a pull request for this comparison 填入信息提交就OKl了。
5. Update 作者最新的代碼
同樣在自己的repo里面,新建一個(gè)pull request,左側(cè)是自己的,右側(cè)是原作者的branch,創(chuàng)建后提交就OK了。
6. rollback repository到某個(gè)commit
github上有時(shí)我們想rollback某個(gè)branch到某個(gè)commit,直接在本地執(zhí)行
[python] view plain copy print?
git checkout <target_branch>
git reset --hard <commit_id>
git push -f
- 2 回答
- 0 關(guān)注
- 712 瀏覽
添加回答
舉報(bào)