PSAS/ git

For new work, we are now using git, instead of Subversion. See gitweb for a list of git projects hosted on this server. (Look for repositories starting with "psas/".)

You can clone any of our git repositories without any special privileges, by using the anonymous git protocol. For example:

git clone git://git.psas.pdx.edu/git/event-driven-fc

Some of our projects depend on further submodules. For instance, event-driven-fc also depends on the ziggurat submodule. To initialize it:

git submodule init
git submodule update

If you're making changes to one of these git repositories and want to be able to share your work with us, please send your preferred SSH username and an OpenSSH public key to admin@psas.pdx.edu. You probably want to choose a username that matches your local username on whatever computer you usually do development work on. If you don't already have an OpenSSH public key, you can generate one with this command:

ssh-keygen -t dsa

Afterwards you can find your new public key in ~/.ssh/id_dsa.pub. (If you already had a key, you might find that it's named ~/.ssh/id_rsa.pub.)

Once your account is created, you need to use the git+ssh protocol to access the repositories you're working on. For example:

git clone git+ssh://git.psas.pdx.edu/git/event-driven-fc

Administrators

Creating a new git account

sudo adduser --disabled-password --shell /usr/bin/git-shell --gecos "<Full Name>" <username>
sudo addgroup <username> psas
sudo -u <username> mkdir /home/<username>/.ssh
sudo -u <username> sponge /home/<username>/.ssh/authorized_keys

Now paste the provided key and press Ctrl-D.

Creating a new git repository

First, set up the git repository on the PSAS server:

cd /git
GIT_DIR=<reponame>.git git init --shared
touch <reponame>.git/git-daemon-export-ok
sudo chown -R <owner>:psas <reponame>.git

Next, make a local repository and put stuff in it:

mkdir reponame
cd reponame
git init

Now commit some content into it. Once you've happily committed content, you can push it to the server:

git remote add origin git+ssh://username@git.psas.pdx.edu/git/reponame
git push origin master
git config branch.master.remote origin
git config branch.master.merge refs/heads/master

Moving SVN to git

You can use the following commands to convert a PSAS svn repo to git:

git svn clone svn+ssh://username@svn.psas.pdx.edu/svn/psas/trunk/svn-repo-name repo-name.git

Then you can use the commands above to push it to a new git repo and thus happily preserve old history.