Git: need to recursively 'git rm' the contents of all bin and obj folders

自作多情 提交于 2019-12-03 02:08:46

Have backups,

 find . -type d -name bin -exec git rm -r {} \;

 find . -type d -name obj -exec git rm -r {} \;

Update

With bash, you can set the shopt globstar, and be happy:

 shopt -s globstar
 git rm -r **/{obj,bin}/

Finally, if you need to remove these from the history of the repository, look at git filter-branch and read the section on 'Removing Objects' from the Pro Git Book

Once you revert (will keep files in history) or reset the commit,

git reset --hard

Once these are ignored files,

git clean -xdf

I use that to clean up before rebuilding a solution. Seems vs uses some dlls even after a checkout of a different branch or a merge.

You shouldn't need to resort to filter branch. Interactive rebase will do. Remember the --preserve-merges flag.

Hope this helps.

Another option is to revert the offending commit with git revert.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!