git merge如何忽略部分路径

参考文章:

Git - Ignore files during merge

How to make git ignore a directory while merging

在进行git merge时,想忽略部分路径的回合。

如:将develop分支merge回master,但是忽略/path/to/folder路径

操作:

复制代码
git checkout master
git merge --no-commit --no-ff develop  
git reset -- /path/to/folder  # 将想忽略的路径从暂存区去掉
git commit  # 做提交
git push origin master  # 推送到master
相关推荐
钟智强31 分钟前
我警告了 329 天
git·php·wordpress·webshell
乐观的冷风2 小时前
我们需要将文件添加到暂存区才能提交,而移除文件后是无法添加到暂存区的,那么怎么移除一个文件让GIT不再将其纳入版本控制呢?上图中GIT已经给出了说明:
git
tjl521314_213 小时前
Git SSH Host Key Verification Failed 问题排查与解决
运维·git·ssh
嘶哈哈哈5 小时前
[特殊字符] Git 协作指南
git
say_fall6 小时前
【Git 精品详解】企业规范:企业级开发模型、Git Flow、发版流程规范、Code Owner 制度、事故应急回滚
大数据·linux·服务器·git·学习·elasticsearch
江畔柳前堤1 天前
第13章:docker生产环境部署实战
运维·git·docker·容器·代码复审
GuHenryCheng1 天前
【ESP32】ESP-IDF开发环境搭建(cursor)
git·stm32·单片机·学习
kaka。。1 天前
GIT安装+代码推送
git
明理的路灯1 天前
安装 git 开发工具
git
偏爱自由 !1 天前
5:IDEA中git的使用--git fetch 和 git pull 和解决冲突
git·elasticsearch·intellij-idea