How to “unversion” a file in either svn and/or git

前端 未结 15 1313
被撕碎了的回忆
被撕碎了的回忆 2020-12-22 19:58

It happens to me all the time. I accidentally version a file, I do not want to be versioned (i.e. developer/machine specific config-files).

If I commit this file, I

15条回答
  •  粉色の甜心
    2020-12-22 20:21

    It sounds like you have already added and committed the file to subversion (I assume that you are using Subversion). If that is the case, then there are only two ways to remove that file:

    1. Mark the file as deleted and commit.
    2. Perform an svnadmin dump, filter out the revision where you accidentally committed the file and perform an svnadmin load.

    Trust me, you don't really want to do number 2. It will invalidate all working copies of the repository. The best is to do number 1, mark the file as ignored and apologise.

提交回复
热议问题