This is for removal of files before pushing to GIT repository during migration source from CVS using Cygwin's cvs2git module.
This is for removal of secret(password, ip, key, etc) from GIT repository using Cygwin's cvs2git module.
We usually have CVS hosted in-house and are nowadays moving to GIT either on cloud or GIT in-premise. When we move from on-premise to cloud, we would want to remove secrets(database username, password, IP addresses, etc) from code before moving to the cloud.
You'll need the git
, cvs2git
and git-cvs
packages.
sudo yum install git-cvs
This example uses the project1 project from CVS, but you can substitute any other module.
To avoid hammering the remote pserver, I just copied the CVS directory straight from the server to a local directory. You can specify the remote pserver as an argument to -d
but it's rather slow.
# use your own project and username...
module=project1
cvsusername=NidhiU
mkdir -p cvs/CVSROOT # CVS will consider cvs to be a valid repo now
scp -r $cvsusername@10.20.20.20:/usr/webdev/cvsroot/$module cvs
Where 10.20.20.20 = IP address of CVS server.
cvs2git \
--blobfile=cvs2svn-tmp/git-blob.dat \
--dumpfile=cvs2svn-tmp/git-dump.dat \
--username=$cvsUsername \
cvs/$cvsAppName
mkdir -p git/"$gitRepoName".git && cd git/"$gitRepoName".git && git init --bare
cat ../../cvs2svn-tmp/git-blob.dat ../../cvs2svn-tmp/git-dump.dat | git fast-import
cd ../ && git clone "$gitRepoName".git $gitRepoName && rm -rf "$gitRepoName".git && cd $gitRepoName
Check git and CVS versions, and verify that your PATH isn't occluded, since we want to use pure cygwin binaries here.
$ which git
/usr/bin/git
$ which cvs
/usr/bin/cvs
$ git --version
git version 2.17.0
$ cvs --version
Step 1 - replace cvs and git credentials in start.sh file.
Step 2 - mention your secret files for removal into conversion.sh
./start.sh or sh start.sh