Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 137005f0f0
Fetching contributors…

Cannot retrieve contributors at this time

44 lines (32 sloc) 1.774 kb

git-tools

git-tools is a collection of scripts and tools to make developing with git and hosting a git repo easier.

Creating a Repository

The mkgit command is provided to create a git repository on the machine you intend to use to host the repo. It assumes you have a user named git and will try to sudo as git if it isn't run as git.

It takes a single argument: the name of the project.

git@code-$ mkgit project-one
Creating repo project-one.git
Initialized empty Git repository in /tmp/project-one.git/

Next steps:
  mkdir project-one
  cd project-one
  git init
  touch README
  git add README
  git commit -m 'first commit'
  git remote add origin git@code:project-one.git
  git push origin master

Existing Git Repo?
  cd existing_git_repo
  git remote add origin git@code:project-one.git
  git push origin master

When you're done, it prints instructions on how to set up the repo on your client (dev) machine. Kudos to github for thinking of this.

github-style post-receive hook

The post-receive script will send a JSON payload to all the uris listed in the repo's hooks.uris configuration option. Most likely you'll want to set it on a system level. Example:

git@code-$ git config -l
uris.project=http://code.example.com/projects/show/%name%
uris.commit=http://code.example.com/repositories/revision/%name%?rev=%id%
hooks.uris=http://localhost:8001/

The above will post to http://localhost:8001/ with the JSON payload. The other two configuration options are for uris that go into the payload, such as the uri for the commit and the uri for the project. The above examples are for Redmine.

Jump to Line
Something went wrong with that request. Please try again.