Smart HTTP Support
Git’s HTTP protocol just upped it a few notches on the ol’ IQ test. As discussed in detail on the Pro Git blog, Git supports a new, much more efficient…
Git’s HTTP protocol just upped it a few notches on the ol’ IQ test. As discussed in detail on the Pro Git blog, Git supports a new, much more efficient HTTP based transport as of version 1.6.6. Well, now GitHub supports that new protocol as well.
From now on, if you clone a repository over the http://
url and you are using a Git client version 1.6.6 or greater, Git will automatically use the newer, better transport mechanism. Even more amazing, however, is that you can now push over that protocol and clone private repositories as well. If you access a private repository, or you are a collaborator and want push access, you can put your username in the URL and Git will prompt you for the password when you try to access it.
Try it out on a public repository:
$ git clone http://github.com/schacon/grack.git
For private repos, or to have push access on your repository, you can clone this way:
$ git clone https://username@github.com/username/project.git
Don’t forget the https
part – Git will send your password hashed but unencrypted over the wire, so be sure to use SSL. In future versions of Git (assuming our patch gets integrated), Git will prompt you for your username if it’s not provided and the client gets a 401, so you won’t actually have to put your username in the URL – it will just ask you when Git needs it.
Older clients will also fall back to the older, less efficient way, so nothing should break – just newer clients should work better.
Let us know if you have any problems with it, and enjoy!
Written by
Related posts
Apply now for GitHub Universe 2023 micro-mentoring
As part of our ongoing commitment to accelerate human progress through Social Impact initiatives, we’re offering students 30-minute, 1:1 micro-mentoring sessions with GitHub employees ahead of Universe.
The 2023 Open Source Program Office (OSPO) Survey is live!
Help quantify the state of enterprise open source by taking the 2023 OSPO survey.
Godot 4.0 Release Party 🎉
We are delighted to host the Godot 4.0 Release Party at GitHub HQ on Wednesday, March 22 from 6:30 pm to 9:30 pm. And you’re invited!