zoukankan      html  css  js  c++  java
  • 保持Git Fork更新并保持整洁

    我不时需要能够跟踪上游的变化,同时保持git commit历史记录的整洁,但是我永远不记得怎么做。我也想避免混乱的合并提交,因为那只是最糟糕的。

    我将假设您已经分叉了一个存储库。我将使用 bopo/mootdx 存储库作为示例。

    追踪变化

    $ git remote add upstream git@github.com:bopo/mootdx
    

    更新

    每当我想更新本地master分支机构时:

    $ git checkout master
    $ git fetch upstream
    $ git rebase upstream/master
    

    更新分支

    对于我要更新的每个分支,我需要先检出该分支,然后将上游更改重新建立基础。我们将根据upstream/mastervs.master进行基准调整,以避免不得不同时对master我们的分支基准进行调整。

    $ git checkout the-branch-to-update
    $ git fetch upstream
    $ git rebase upstream/master
    
  • 相关阅读:
    such用法
    divorce用法
    towel用法
    go for用法
    catch on用法
    incredibly用法
    mess用法
    dentist用法
    steer clear of用法
    incredible
  • 原文地址:https://www.cnblogs.com/bopowang/p/14128306.html
Copyright © 2011-2022 走看看