How does Github for Mac synchronize?

前端 未结 2 1248
傲寒
傲寒 2021-02-02 04:35

According to the Github for Mac blog announcement,

Once you\'re ready to share your commits, or pull in remote commits — just press the Sync Branch butto

2条回答
  •  天命终不由人
    2021-02-02 05:09

    Although @VonC’s answer is pretty darn useful, I wanted to mention of newer legit. Basically what legit does is a smart merge (much similar, if not equal, to what GitHub for Mac does):

    1. Check the log for merge commits with git log --merges branch..from_branch
    2. And if there’s any, then do the usual merge, otherwise do a rebase

    git pull --rebase doesn’t work as per @VonC’s answer, whereas git rebase --preserve-merges is kinda better, but creates duplicate commits if you have merged other branches in; so you need to decide at some point if “rebase” is actually makes sense, or should you “merge” instead and that’s what legit does precisely (again: just like GitHub for Mac).

提交回复
热议问题