Tuesday, October 2, 2018

How to do a full-text search in SVN repository



SVN clients like TortoiseSVN does not come with the content search support. It can be done by using Git SCM client.

Installation:

Please follow the below steps on Windows

Goto https://git-scm.com/download/win

Download & install the exe file

Copying SVN Content to Local Drive:
Create a folder in any drive. e.g. D:\myrepo

Go to windows command prompt

Then from command prompt navigate to D:\myrepo (using cd)

Clone the SVN repository to the local drive (D:\myrepo) by executing below command

git svn clone <SVN_URL>

You will be prompted for username/password in command prompt while downloading the SVN content

Search the content:

Once the download is finished in D:\myrepo; execute the below command providing the text to be searched in <keyword>.

git grep -i <keyword> [e.g. git grep -i abcd]

-i is used to provide case-insensitive content search. To make the search case-sensitive remove -i option


The list of files with contents will be printed in the command prompt

Convert Java Project from Log4j 1 to Log4j2

Many times while working on old Java projects we find Log4j 1.x is used. But as the Log4j2 is the new one; hence to upgrade to Log4j2 we nee...