Remove and ignore all files that have an extension from a git repository

前端 未结 4 1262
深忆病人
深忆病人 2020-12-23 09:54

I\'m working on a django project with a few other developers and we have recently realized that all the .pwc files in our app cause the commits and repository to be cluttere

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-23 10:29

    You can also use the following:

    git rm -r '*.pwc' 
    

    and then make those files ignored by git:

    echo '*.pwc' >> .gitignore
    

    The last one is in case if you already have .gitignore file, if not, us single '>' sign.

提交回复
热议问题