Github Fork同步

作者:Thousand_Star 发布时间: 2023-04-12 阅读量:26

Github Fork同步

  1. 查看远程仓库路径
    git remote -v

  2. 设置上游服务器
    git remote add upstream xxx.git

  3. 拉取上游服务器的代码,并且强制提交(适用于只是使用别人的项目而不提交自己代码的项目)
    git fetch upstream && git reset --hard upstream/main && git push -f