Github进行fork后如何与原仓库同步
cd Documents/github/segmentfault-lessons
git remote -v
> origin git@github.com:morningcat2018/segmentfault-lessons.git (fetch)
git remote add upstream https://github.com/mercyblitz/segmentfault-lessons.git
git remote -v
> origin git@github.com:morningcat2018/segmentfault-lessons.git (fetch)
> origin git@github.com:morningcat2018/segmentfault-lessons.git (push)
> upstream https://github.com/mercyblitz/segmentfault-lessons.git (fetch)
> upstream https://github.com/mercyblitz/segmentfault-lessons.git (push)
git fetch upstream
> remote: Enumerating objects: 154, done.
> remote: Counting objects: 100% (154/154), done.
> remote: Compressing objects: 100% (71/71), done.
> remote: Total 264 (delta 61), reused 147 (delta 54), pack-reused 110
> 接收对象中: 100% (264/264), 50.78 MiB | 53.00 KiB/s, 完成.
> 处理 delta 中: 100% (71/71), 完成 8 个本地对象.
> 来自 https://github.com/mercyblitz/segmentfault-lessons
> * [新分支] master -> upstream/master
git merge upstream/master
> 更新 0940276..549b640
> 正在检出文件: 100% (87/87), 完成.
此时:本地仓库已更新至 upstream/master 相同commit
git push origin
推送至自己的远程仓库上
关于代理
添加代理
git config --global http.proxy 'socks5://127.0.0.1:1087'
git config --global https.proxy 'socks5://127.0.0.1:1087'
查看
git config --global http.proxy
git config --global https.proxy
取消
git config --global --unset http.proxy
git config --global --unset https.proxy
参考资料:https://blog.csdn.net/matrix_google/article/details/80676034