Ignore specific changes to a file in git, but not the entire file

前端 未结 9 1803
春和景丽
春和景丽 2020-12-28 12:14

I have a file in a git repository that has a local change on it. I want to have git ignore the local change forever, but not the file. In particular,

  • If the fi
9条回答
  •  悲&欢浪女
    2020-12-28 12:35

    If you can't use .gitignore as you need to make parallel changes in the same file(as found in your comments) then one option is git add -p Using this you can add or skip accordingly.

    The problem using the above git command here is, it will be more of a manual process. I guess you may not find any other automated approach for you problem.

提交回复
热议问题