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

前端 未结 25 1598
慢半拍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:06

    A simple approach for selective merging/committing by file:

    git checkout dstBranch
    git merge srcBranch
    
    // Make changes, including resolving conflicts to single files
    git add singleFile1 singleFile2
    git commit -m "message specific to a few files"
    git reset --hard # Blow away uncommitted changes
    

提交回复
热议问题