2 回答

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