Hasty Briefsbeta

Bilingual

You Already Have a Git Server

6 months ago
  • #ssh
  • #git
  • #version-control
  • Clone a git repository on a server with SSH access using `git clone ssh://username@hostname/path/to/repo`.
  • Enable pushing to the currently checked-out branch on the remote server with `git config receive.denyCurrentBranch updateInstead`.
  • Publish code by pointing a web server to the git repo, optionally removing the `.git` part for cleaner URLs.
  • Run `git update-server-info` server-side to make the repo cloneable over HTTP.
  • Automate `git update-server-info` by setting up a post-update hook.
  • Git hooks can be customized to run scripts, such as static site generators, after updates.
  • Using git for syncing work between computers provides automatic backups and version tracking.