Git Hosting

Published
Length
3 min read

Luis Felipe Dias

All posts

Git hosting runs on central servers that store your code and track changes. You set up git hosting by creating repos, adding SSH keys, and assigning team roles. Many teams start by giving all developers broad write roles to move fast. Broad roles let anyone push bad code or read secret scripts across every repo. When a laptop gets lost, those stored keys put all your code at risk. How git hosting permissions and roles work A git hosting server checks who you are before it lets you read or wri

Git Commit Signing (GPG, SSH): the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

Git hosting runs on central servers that store your code and track changes. You set up git hosting by creating repos, adding SSH keys, and assigning team roles. Many teams start by giving all developers broad write roles to move fast. Broad roles let anyone push bad code or read secret scripts across every repo. When a laptop gets lost, those stored keys put all your code at risk.

How git hosting permissions and roles work

A git hosting server checks who you are before it lets you read or write code. Developers create SSH key pairs or personal tokens on their own machines. They upload the public part of the key to their account profile. When a developer runs a pull or push command, the server checks that key. After login succeeds, the server looks up the user role for that specific project.

Most servers split roles into read, write, and admin levels. Read roles let a user clone the repo and view past commits. Write roles let a user push new branches and merge code changes. Admin roles let a user delete branches, add webhooks, and change project settings. Teams also group users into squads so they can assign repo roles in bulk. Branch rules then block direct pushes to the main branch without a peer review.

Where native repo controls fall short in practice

Native repo settings do a good job of guarding static source code files. They decide who can clone a project and who can merge a pull request. Still, repo roles stop working once code leaves the server or runs in production. Developers often need to run scripts or inspect live systems during an incident.

Static repo keys and roles only check who logs in at the start. They do not inspect the actual commands or queries a user runs next. A user with a valid key can run a destructive command without extra checks. Also, long-lived tokens sit on developer laptops for months without expiring. If an attacker steals a token, they get full write rights right away. Teams also lack a clear audit log linking repo changes to live system commands.

Git Commit Signing (GPG, SSH): architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Steps to harden your code and server workflows

Start by removing broad write roles from your main code projects today. Give most team members read roles and require pull requests for all changes. Set at least two reviewers for any change touching core app logic. Next, put an expiration date on every personal token and SSH key.

Keep secret keys, database passwords, and tokens out of your git history. If a secret enters a commit, rotate that key right away. Separate the roles for writing code from the roles for running production tasks. Make sure every action on a live server ties back to one person. Review your access logs each month and delete old accounts that nobody uses.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

What is the difference between git and git hosting?

Git is a tool that tracks code changes on your local computer. Git hosting is a remote server service that stores those code repos for teams.

Should teams use SSH keys or personal tokens for repo logins?

Both work well when you set short expiration dates on them. Hardware-backed SSH keys offer strong security because attackers cannot copy the private key file.

How do we stop developers from pushing secrets to a repo?

Use pre-commit hooks on developer laptops to scan files before every commit. Also turn on server-side secret scanning to block pushes that contain active keys.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.