Guide Setup for use as a Redmine Hacks Developer

Basic Git Installation and Configuration

Before starting here, visit my 5-Minute Git Guide for information on installing Git and basic configuration.

Create your SSH public key

There are many guides out there, but Github has a very simple one. It covers Linux, Mac, and Windows. Get it here: http://github.com/guides/providing-your-ssh-key

Once you have your SSH public key, you will need to attach it to your NewHack request, or to your request to be added as a Git contributor.

Once you've been added, then you can move on to...

First Upload of Your Project

Importing your project into Git.

If you haven't yet stored you project in Git at all, follow this section. If you are already using Git locally, skip to the next section.

cd into your project's code directory. Clean it up so there are no backup files, temporary files, etc. lying around. Then:

git init
git add .
git commit

Give an initial commit comment.

Initial push

Now, tell Git how to talk to the server:

git remote add origin ssh://git@git.redminehacks.org:7722/projectname.git
git push --all

Replace projectname with the project identifier (URL component) of your project.

If you want to copy your tags to the remote as well, also run:

git push --tags

Your tree will appear in the Repository tab and in Gitweb in less than 30 minutes. (After the initial delay, all updates should be immediate)

Prepare to clone

Next, cd .. from your project and rename it to a temporary directory. You will now re-clone the project from the server. Strictly speaking, this isn't necessary, but it's handy for two reasons:

  1. It automatically marks all your local branches to track remote ones
  2. It gives you an opportunity to test and make sure everything looks right

Cloning your Git Repository

For project managers only, you clone your git repository like this:

git clone ssh://git@git.redminehacks.org:7722/projectname.git

Of course, replacing projectname with the URL component (project ID) you are using.

Routine Use

Work on your local repository. git commit -a changes, etc. (See the 5-minute Git Guide).

When you're ready to push your branch, just say:

git push

That will push it up to the server.

Other useful commands:

  • git push --all pushes all branches
  • git push --tags pushes tags (tags are not pushed by default)

If you have more than one committer, or use more than one PC, git pull will pull down changes from other committers/machines from the Redmine Hacks server to your PC.

Also available in: HTML TXT