Git - Temporarily ignore trivial changes to files

前端 未结 4 1326
逝去的感伤
逝去的感伤 2021-01-29 22:22

I\'m looking for a way to \'hide\' minor changes made to a few files in Git, such that they will not show up in git status until a different change is made to those files.

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-29 23:16

    Keep your changes that are not ready in a separate branch. git rebase this branch atop new changes in the main history as necessary.

    Be it development in progress, temporary things, even things that are never to be included in the main project history -- the same process works equally well.

    If/when the changes of the branch are ready to be included in the main history; merge it in. If not, keep them in the separate branch and continue rebasing.

    (side note: git merge --no-ff may be of use to create a merge-commit even if a fast-forward merge is possible -- depending on the rules of your project, this may be preferable)

提交回复
热议问题