How to make git ignore a directory while merging

前端 未结 2 1716
你的背包
你的背包 2020-12-04 13:27

As interesting and useful as the answer to How to setup a git driver to ignore a folder on merge was, it did not answer the original question which still has me stumped.

2条回答
  •  不知归路
    2020-12-04 14:02

    I don't actually use Git, but I think this would work for your case:

    Use something like what's specified here: https://gist.github.com/564416

    git checkout master    
    git merge --no-commit --no-ff development
    git reset -- /path/to/folder # revert updates from path
    git commit
    

    Again, I don't use git, I am just deferring to how I think things work based on my experience with TryGit.

    1. checkout master
    2. merge, but don't commit, no fast forward.
    3. merges are now staged, so reset that entire directory tree
    4. commit

提交回复
热议问题