代码之家  ›  专栏  ›  技术社区  ›  FabricioG

为什么我的git分支与主分支不匹配,因为它说它已经是最新的了

git
  •  0
  • FabricioG  · 技术社区  · 4 年前

      feature/product
      frontend/product
    * master
    

    我在分支功能/产品中做了一些更改-这些更改很好,我想合并。这同样适用于前端/产品。 我做的是结帐师傅。那么

    git merge feature/product
    


    然后从master I运行git status: nothing to commit, working tree clean 但是,我对功能/产品的更改没有出现。 当我签出特性/产品时,更改就在那里。如何合并要在主控形状上显示的功能/产品?

    1 回复  |  直到 4 年前
        1
  •  1
  •   Allan Wind    4 年前

    工作流程非常简单:

    $ git checkout -b branch
    $ git add files_that_changed
    $ git commit -m 'reason why'
    
    $ git checkout master
    $ git merge branch
    

    git checkout master , git status git状态 在你的分支中,它也不会告诉你任何有趣的事情。合并后,如果配置了远程 我会告诉你你前面有n(我不记得确切的信息)。

    你可以用 git log master..branch git diff master..branch