git error setting certificate verify location

After installing Windows on another drive and logged in the new Windows, previous Git installation drive path is changed: for my case, it's changing from D:\ to J:\

Then I updated the PATH variable to add Git path, but when running git clone using https url, following error appeared:

the CAfile location should be H:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt for current newly installed Windows, while the error information indicates it's still using the old path.

Solution

To fix it, we need modify git system config variable: http.sslcainfo

Try git clone again, it works now.

How to use git-ftp on Windows

Background

Before introducing how to use git-ftp on windows, I want to tell some story.

Two years ago, I used Filezilla and ftp to deploy websites. If some files are changed, I have to upload these files manually again. Finding changed files is a time-wasting progress, I have to say. But worse thing is sometimes I forgot which files are changed and I didn't upload all changed files. Then client saw the website is broken and complained to me. It's really painful..

Later I heard about git and started learning it. Using git to deploy is a happy progress. I don't need to find changed files or upload them one by one manually.

But what if some cheap web hosting solutions don't support ssh or git? Finally I found git-ftp

 

What is git-ftp?

Git-ftp is a deployment tool to deploy your changed files which are tracked by git. It's useful because some web hosting companies don't support ssh or git, but only FTP.

But git-ftp is a Linux shell script, so we need to install cygwin to run this script on windows.

 

Requirements

  • Download git-ftp from GitHub
  • Download msysgit from Google Code, and make sure you check "add msysgit path to PATH environment variable" option during installation.
  • Cygwin
    Cygwin is a command line environment providing common Linux tools
    Download cygwin from here, install it using default options.

 

After Installation

Then open cygwin from desktop or start menu, go to the directory containing git-ftp script file (the drives are under /cygdrive directory, such as /cygdrive/c, /cygdrive/d, etc.)

cd /cygdrive/d/Downloads/git-ftp-0.8.4.0

And make git-ftp script file executale

chmod +x git-ftp

Next copy it to /bin directory so that you can run it from anywhere

cp git-ftp /bin

 

Now it's done, Let's run it!

Initialization

Since this is the first time we use it, we need to run "git ftp init" for initial push

git ftp init -u foo -p - ftp://example.com/directoryA

This will configure your FTP server with specified host address, user name and password.

git-ftp

git-ftp windows

Pushing

Running following command to push your staged files tracked by git

git ftp push

 

After uploading is done, it will remember this version as last deployment, so if you run "git ftp push" later, it will upload changed files compare to this version and set new version as last deployment.