0

JHBuild uses the git protocoal instead of https for cloning the files. I am working in a proxy environment which prevents the cloning using the git protocol.

git url of sample gnome repo : git://git.gnome.org/gnome-common

http url of sample gnome repo: http://git.gnome.org/browse/gnome-common.

Is there any way to transform the git url to https format automatically when JHBuild executes the clone command.

Vishnu Ks
  • 483
  • 1
  • 5
  • 18

2 Answers2

2

The gnome moduleset defines git.gnome.org as using git:// but this can be changed in the jhbuildrc file.

Add the following line in jhbuildrc.

repos['git.gnome.org'] = 'http://git.gnome.org/browse/'

The file is present usually in ~/.config. Create jhbuildrc file if not present.

Vishnu Ks
  • 483
  • 1
  • 5
  • 18
1

If you can't clone a repository with a git:// url because of a proxy or firewall, here is a little git configuration that will force git to use http:// even when you'll type git:// URL.

git config --global url."http://".insteadOf git://

With this command, it will add the following lines in you .gitconfig :

[url "http://"]   
    insteadOf = git://

That way, you don't have to care about using git:// or http:// when you are cloning repo, both urls will work.

Maybe a well known tweak but discovered it lately...

CodeWizard
  • 128,036
  • 21
  • 144
  • 167