Setup a new client computer to use git over https

Download certificate to the users homedir.

Get the certificate from Chrome:

  • Click on certificate info left of the addressline
  • Click Certificate Information
  • Tab to Details and export the certificate to [homedir]/

As the user:

 git config --global --add http.sslCAInfo [homedir]/

This will add the following lines to [homedir]/.gitconfig:

   sslCAInfo = [homedir]/

Make sure that git is installed with curl support (USE=curl on Gentoo).

NOTE: Curl needs to be compiled with gnutls support (USE=gnutls on Gentoo).

If curl is not compiled with gnutls you may get an error like this:

  nemo@ljovin ~/projects $ git clone
  Cloning into lpr_server...
  error: SSL certificate problem, verify that the CA cert is OK. Details:
  error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing
  fatal: HTTP request failed

A temporary fix is to avoid verifying the certificate:

nemo@tyr ~/projects $  env GIT_SSL_NO_VERIFY=true git clone

Make first checkout

As the user:

git clone https://[user][repo].git

This will promt for the password set earlier and create the folder [repo] in the current working directory.

Problems with git push

If you get the following error:

  [piparum@everett lpr_server]$ git push origin master
  Unable to create branch path
  Error: cannot lock existing info/refs
  error: failed to push some refs to ''

you can write the following in ~/.netrc

  login [username]
  password [password]

If you get the following warning when cloning a repository:

  [nemo@holger my_repo]$ git clone
  Cloning into liblpr...
  warning: You appear to have cloned an empty repository.

and this while trying to push:

  [nemo@holger my_repo]$ git push  
  No refs in common and none specified; doing nothing.
  Perhaps you should specify a branch such as 'master'.
  Everything up-to-date

You can fix it by:

  [nemo@holger my_repo]$ git push origin master
  Fetching remote heads...
  updating 'refs/heads/master'
    from 0000000000000000000000000000000000000000
    to   e2953e41f3da8786182453db26cdfe46e51ec5e3
      sending 12 objects
  Updating remote server info
   * [new branch]      master -> master
git.txt · Last modified: 2012/02/04 15:29 by jsc
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki