git将一个分支的某个文件合并到当前分支

有时在开发的feature中,整个分支的功能并没有完成开发完成,但是,有几个修改的基础文件需要合并到develop中,这个时候的操作步骤为:

git checkout develop     //切换到Develop分支

git checkout feature/new1.1 -- usercontroller.php  //将feature/new1.1中的usercontroller.php合并到develop分支中

git commit usercontroller.php -m 'xxx'    //提交文件

原文地址:https://www.cnblogs.com/mingaixin/p/5112773.html