
- 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 - 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 - Dumb HTTP
Git dumb HTTP protocol is also known as the Legacy HTTP Protocol. It is the older and simpler method of serving the Git repositories over HTTP.
Git is treated like a collection of files, where the files are served statically.
Key Features
1. File-based System − In dumb HTTP, the files are served statically. The objects such as commits, blobs, trees, etc. are retrieved by downloading them one after the other from server.
2. Git-specific Logic Missing − No Git-specific services or commands are required on server. Any available web server, such as Apache can serve the git directory as a set of files.
3. Inefficient − As the server does not require any Git-specific commands, the user has to clone, pull, fetch, etc. one at a time. This makes the whole process considerably slow.
4. Smart Negotialtion Missing − Reduntant and unnecessary downloads of objects take place, as Dumb HTTP does not negotiate with client.
5. Read-Only − Dumb HTTP is read-only. It lets you clone, pull, and fetch from a repository, but you can not push anything to server
The web server serves the raw Git repository as files straight up in Dumb HTTP.
A bare Git repository must be installed beneath the HTTP document root in order to set up Dumb HTTP, and a post-update hook must be set up to handle repository updates.
After enabled, Dumb HTTP can be used to clone the repository by any user having access to the web server hosting it.
Though it lacks Smart HTTP's sophisticated features, Dumb HTTP makes Git operations over HTTP simpler and more accessible.
How It Works?
A series of HTTP requests are made, when you clone or fetch a repository:
Individual objects from the .git/objects/ directory.
Information about references (refs) from .git/refs.
Pack Files from .git/objects/pack.
As each object in dumb HTTP is considered and downloaded as a separate HTTP request, the overall performance is slow.
To enable read access to our Git repository over HTTP, follow these steps:
cd /var/www/htdocs/ git clone --bare /path/to/git_project gitproject.git cd gitproject.git mv hooks/post-update.sample hooks/post-update chmod a+x hooks/post-update
Git's default post-update hook runs git update-server-info to keep HTTP fetching and cloning working properly.
This hook is automatically triggered when changes are pushed to a repository, including over SSH.
Once the repository has been pushed, other users can clone it by running commands like git clone http://example.com/path/to/repo.git.
By retrieving an entire copy of the repository, this command makes sure that all relevant metadata is current and available over HTTP.