Recently while working on a project I found that we were keeping .svn metadata in our Git repo.
It was not desirable to keep that in the Git repo but we needed to keep those .svn object in the local filesystem.
The below steps allowed me to do that:
1) Find all the .svn objects
find . -name .svn | xargs -n1
2) Remove them from Git
The (–cache) flag keeps them on disk and (-r) does it recursively
find . -name .svn | xargs -n1 echo git rm --cache -r
3) Add a .gitignore file with contents below to prevent tracking of .svn objects
.svn
4) Commit changes
git commit -m "Delete .svn metadata from project"
5)Verify
git status git diff
Comments
Leave a comment Trackback