How can I selectively merge or pick changes from another branch in Git?

前端 未结 25 1971
慢半拍i
慢半拍i 2020-11-22 02:53

I\'m using Git on a new project that has two parallel -- but currently experimental -- development branches:

  • master: import of existing codebase pl
25条回答
  •  不要未来只要你来
    2020-11-22 03:23

    The easiest way is to set your repository to the branch you want to merge with, and then run

    git checkout [branch with file] [path to file you would like to merge]
    

    If you run

    git status
    

    you will see the file already staged...

    Then run

    git commit -m "Merge changes on '[branch]' to [file]"
    

    Simple.

提交回复
热议问题