在GitHub上Fork后找到你的Repositories点击项目clone到本地
git clone <URL>(Fork后的项目地址)
同步Fork项目的状态
1. 首先要先确定一下是否建立了主repo的远程源:
git remote -v
2. 如果里面只能看到你自己的两个源(fetch 和 push),那就需要添加主repo的源:
git remote add upstream <URL>(要Fork的开源项目地址)
git remote -v
3. 同步状态
git fetch upstream <branch>
git rebase upstream/<branch>
git push -f origin //强制push
如果在你GitHub上Fork的项目下看到This branch is even with XX:<branch>
,则表示同步成功!
4. 项目改动
开始你对开源项目的改动
完成后
git commit -m "备注"
git push origin <branch>
进入你Fork项目看见This branch is X commits ahead XX:<branch>
则可以Pull requests,如果有behind则要重新同步