- Getting Started with Git
- Git - Home
- Git - Version Control
- Git - Basic Concepts
- Git - Command Line
- Git - Installation
- Git - First Time Setup
- Git - Basic Commands
- Git - Getting Help
- Git - Tools
- Git - Cheat Sheet
- Git - Terminology
- Git Basics
- Git - Life Cycle
- Git - Get a Repository
- Git - Adding New Files
- Git - Recording Changes
- Git - Viewing Commit History
- Git Branching
- Git - Branches in a Nutshell
- Git - Creating a New Branch
- Git - Switching Branches
- Git - Branching and Merging
- Git - Merge Conflicts
- Git - Managing Branches
- Git - Branching Workflows
- Git - Remote Branches
- Git - Tracking Branches
- Git - Rebasing
- Git - Rebase vs. Merge
- Git - Squash Commits
- Git Operations
- Git - Clone Operation
- Git - Tagging Operation
- Git - Aliases Operation
- Git - Commit Operation
- Git - Stash Operation
- Git - Move Operation
- Git - Rename Operation
- Git - Push Operation
- Git - Pull Operation
- Git - Fork Operation
- Git - Patch Operation
- Git - Diff Operation
- Git - Status Operation
- Git - Log Operation
- Git - Head Operation
- Git - Origin Master
- Git Undoing
- Git - Undoing Changes
- Git - Checkout
- Git - Revert
- Git - Reset
- Git - Restore Operation
- Git - Rm
- Git - Switch Operation
- Git - Cherry-pick
- Git - Amend
- Git on the Server
- Git - Local Protocol
- Git - Smart HTTP Protocol
- Git - Dumb HTTP Protocol
- Git - The SSH Protocol
- Git - The Git Protocol
- Git - Getting Git on a Server
- Git - Setting up the Server
- Git - Daemon
- Git - GitWeb
- Git - GitLab
- Git - Third Party Hosted Options
- Distributed Git
- Git - Distributed Workflows
- Git - Contributing to a Project
- Git - Maintaining a Project
- Customizing Git
- Git - Configuration
- Git - Hooks
- Git - Attributes
- Git - Init
- Git - Commit
Git - Smart HTTP
Git smart HTTP protocol is the newer and more advanced method of serving the Git repositories over HTTP. It is also known as modern HTTP protocol.
Git 1.6.6 brought a more smart protocol that allowed Git to negotiate SSH-like data exchanges.
The more recent protocol, known as Smart HTTP, has gained popularity due to its intelligent communication techniques and friendly structure.
On the other hand, the previous technique, known to as Dumb HTTP, took a less advanced approach to communication and data transport.
Key Features
Smart HTTP uses standard HTTPS ports and functions similar to the SSH or Git protocols.
It is compatible with multiple HTTP authentication protocols, including username/password authentication.
1. Git-Aware Server − Various Git-specific services and commands are understood by the server, such as git-upload-pack and git-receive-pack.
2. Smart Negotiation − Negotiation takes place between the server and the client. It avoids reduntant data getting transferred, making it more effcient than Dumb HTTP Protocol.
3. Decline in HTTP Requests − As redundant data is not getting transferred, the number of HTTP requests is reduced. Multiple objects get combined in compressed packfiles improving the performance.
4. Efficient Cloning − Smart HTTP reduces the numbers of objects sent while cloning a repository and uses the Git-specific optimizations to make the whole process quick.
5. Authentication − Authenticated access is commonly done over HTTPS using passwords, tokens, or OAuth-based mechanisms. Smart HTTP supports both anonymous access and authenticated access.
6. Supports Pushing − Unlike Dumb HTTP, Smart HTTP allows you to push changes to a remote repository. Thus making it completely functional for both read and write operations.
This increases convenience for individuals who might find it difficult to set up SSH keys.
Secure data transport across the network is further ensured by Smart HTTP's usage of HTTPS.
Smart HTTP combines features of secure pushing with authentication and encryption (like SSH) with anonymous serving (git:// protocol).
It removes the requirement for different URLs by allowing the use of a single URL for both pushing to repositories and retrieving content from them.
To ensure secure interactions, the server may ask for a username and password while pushing to an authenticated repository.
Repositories can be viewed, cloned, and pushed using the same URL (https://github.com/user/repo) depending on the rights of the user due to the effective use of Smart HTTP by platforms such as GitHub.
This unified method improves access control measures and simplifies repository management.
How It Works?
Two main Git commands are used on the server:
git-upload-pack − Operations like git fetch and git pull are used by sending the necessary objects to the client.
git-receive-pack − Operations like git push are used by receiving the necessary objects sent by the client and repository getting updated.
Advantages
The Smart HTTP protocol has the following advantages:
The Smart HTTP protocol makes access easier by requiring only one URL for all actions and only requesting authentication when needed.
Compared to SSH key management, users can authenticate using their usernames and passwords, which makes it easier to use, especially for less experienced users or systems that are not used to utilizing SSH.
Similar to SSH, smart HTTP provides quick and effective performance.
For further security, repositories can optionally be hosted in read-only mode over HTTPS, guaranteeing encrypted content transfer.
To further protect the communication, clients may be made to use particular signed SSL certificates.
Widely supported protocols like HTTP and HTTPS are frequently permitted by corporate firewalls, making access easier in networks with restrictions.
Disadvantages
The following are some of the disadvantages of using Smart HTTP for Git repositories:
On some servers, configuring Git over HTTPS can be tougher than configuring SSH, which increases the overhead associated with initial configuration.
In spite of this complexity, Smart HTTP offers significant benefits over alternative protocols when it comes to delivering Git information.
Managing credentials for HTTP authenticated pushing can be more difficult than for SSH keys.
By securely storing passwords, programs like Credential Manager for Windows and Keychain for macOS make credential management easier.
The Git documentation's Credential Storage section contains setup instructions for secure HTTP password caching.
Smart HTTP Protocol is the preferred, modern method for interacting with remote repositories over HTTP/HTTPS, providing efficiency, performance, and full Git functionality, including authentication and push capabilities.