git更新forked的项目

如何更新forked过来的项目。

方法如下:

  1. 添加原项目的remote源,只需要添加一次就行

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    git remote add upstream git@github.com:soimort/you-get.git
    ```

    2. 将本地修改的commit下

    3. push前执行
    ```
    git remote update upstream
    git checkout {branch name}
    git rebase upstream/{branch name}
  2. 最后进行push

    1
    git push origin {branch name}
您的支持将鼓励我继续创作!