Setup a new client computer to use git over https

Download git.oftal.dk certificate git.oftal.dk.crt 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]/git.oftal.dk.crt

As the user:

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

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

 [http]
   sslCAInfo = [homedir]/git.oftal.dk.crt

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 https://git.oftal.dk/lpr_server.git
  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 https://git.oftal.dk/lpr_server.git/info/refs
  
  fatal: HTTP request failed

A temporary fix is to avoid verifying the certificate:

nemo@tyr ~/projects $  env GIT_SSL_NO_VERIFY=true git clone https://nemo@git.oftal.dk/my_repo.git

Make first checkout

As the user:

git clone https://[user]@git.oftal.dk/[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 https://piparum@git.oftal.dk/lpr_server.git/info
  Error: cannot lock existing info/refs
  error: failed to push some refs to 'https://piparum@git.oftal.dk/lpr_server.git'

you can write the following in ~/.netrc

  machine git.oftal.dk
  login [username]
  password [password]

If you get the following warning when cloning a repository:

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

and this while trying to push:

  [nemo@holger my_repo]$ git push  
  Password: 
  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
  Password: 
  Password: 
  Fetching remote heads...
    refs/
    refs/heads/
    refs/tags/
  updating 'refs/heads/master'
    from 0000000000000000000000000000000000000000
    to   e2953e41f3da8786182453db26cdfe46e51ec5e3
      sending 12 objects
      done
  Updating remote server info
  To https://nemo@git.oftal.dk/my_repo.git
   * [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