You won't want to use Git without this anymore. If you used the OSX installer, add this to your
If you installed Git with MacPorts, then add this line to your
Git at Magnolia - The following information is very much outdated. We now use BitBucket for git.
Repositories hosted at
git.magnolia-cms.com are accessible via a number of URLs:
- read-only over HTTP:
http://git.magnolia-cms.com/<repo>.git. You can use this to clone, fetch and pull a repository, but you won't be able to push. This is only available for our open-source projects.
- authenticated HTTPS:
https://git.magnolia-cms.com/<repo>.git. Allows you to push - if you're allowed to for the given repository, anyway. Use your Magnolia credentials. (see #HTTP credentials below)
email@example.com:<repo>.git. Allows you to push - if you're allowed to for the given repository, anyway. Uses SSH keys, so make sure we have it.
- Lastly, you can also browse them on Gitweb at
<repo> is the name or path of the repository you want to clone, e.g.
git clone firstname.lastname@example.org:modules/dms.
To know what repositories are available, or to validate your configuration, you can simply try to connect to the server:
# Anonymous: curl -s http://git.magnolia-cms.com/info # HTTPS: curl -u <user>:<pass> -s https://git.magnolia-cms.com/info # Or if you prefer to use the SSH protocol, and we have your key: ssh email@example.com info
This should get you a message such as
hello jdoe, this is gitolite v2.3-2-gd75a165 running on git 18.104.22.168 the gitolite config gives you the following access: R W modules/foobar R modules/bazqux @R_ @W_ testing Please see http://wiki.magnolia-cms.com/display/DEV/Git+usage for details.
This means you can read/write the
modules/foobar repository, and have read-only access to the
modules/bazqux repository. Additionally, you have full access to the
testing repository, like everyone else.
If on the other hand, if you get this message:
Permission denied (publickey).
... that means your public key isn't configured properly (either on your machine, or on the server). To only way to fix this at the moment is to contact me directly; send me your public key.
Have a look at Git repositories structure for details on how repositories are structured.
Hey, this repository moved !?
Have a look at Git repositories structure for details on how repositories are structured, and where projects migrated from SVN have been moved to.
Hey, now I have been granted write access to this repository, what do I do ?
In both cases, what you need to do is change the URL of the "remote" you're using for that repository. If you're familiar with Git, you'll know how to do this, and you might even feel comfortable with using multiple remotes. If not, this is a simply way to change the default remote (usually named
# See the current remotes and their URLs: git remote -v git remote set-url origin <new-url> # Check: git remote -v
So whether a repository has been moved (perhaps to a new subfolder on the same server, perhaps to another server), renamed, or you now need to use HTTPS or SSH instead of HTTP, you know what to do.
Tags, branches, detached mode
Since many of our Git repositories have been migrated from our Subversion repository (see below), there are a lot of projects where tags and branches have the same name (typically
magnolia-module-xyz-1.2 is both a branch and a tag). If you attempt to
git checkout magnolia-module-xyz-1.2, you'll end up in detached mode, AND your local copy will reflect the contents of the tag. If you did want the tag, all is fine and dandy. If you wanted the branch, you need to do two things:
- provide git with the full name of the reference for this branch.
origin/magnolia-module-xyz-1.2usually does the trick, although the real full name is likely going to be
create the branch locally and track it (if you checkout a branch, by default it's "remote", which is why you'll still be in detached mode if you just do
git checkout origin/magnolia-module-xyz-1.2, so you'll need to instruct Git to "create" that branch locally and map it to the remote branch)
The long version of this is
git checkout -b magnolia-module-xyz-1.2 refs/remotes/origin/magnolia-module-xyz-1.2
.. but a shortcut that should work just as well for more situation is:
git checkout -t origin/magnolia-module-xyz-1.2
If you have an account at Magnolia (as a community/forge member, a customer, or even an employee), you should be able to clone repositories from our Git repository. If you don't, the open source repositories should still be visible on GitWeb; you should be able to clone them anonymously.
If your credentials don't seem to work like they did with SVN, please get in touch !
To avoid typing your credentials over and over again, you should make sure you have Git 1.7.9+, and do one of the following:
# On OSX: ## Check if you have osxkeychain installed git credential-osxkeychain ## if yes then tell git to use them git config --global credential.helper osxkeychain ## If you do not have osxkeychain helper, you can simple install it (see below "Add keychain credential support if you use the Git installer"). Or you can use store helper instead. # On another OS: git config --global credential.helper store # stores credentials in ~/.git-credentials
There are other credential storage available depending on your installation; find them with
git help -a | grep credential-. For more details, see http://www.manpagez.com/man/7/gitcredentials/
If you're using the Mac OSX installer, it seems the keychain credentials support isn't included yet - vote for http://code.google.com/p/git-osx-installer/issues/detail?id=82 - in the meantime, you can download and install it manually:
curl -s -O http://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain chmod u+x git-credential-osxkeychain sudo mv git-credential-osxkeychain /usr/local/git/bin/
The server and migration of the canonical/remote repositories is described on our SYS wiki.
The migration status is documented on the Git repositories structure page.
To switch your local copy from Subversion to Git, just do a clone, and replace the directories. Since the Subversion repository remains accessible in read-only mode, you can apply any local changes you had with commands along these lines: ( this script is only an example, take it with a pinch of salt and adapt it to your own needs)
cd some-project # /path/to/your/svn/working/copy svn diff > ~/temp.patch mv `pwd` `pwd`-svn-backup cd .. git clone firstname.lastname@example.org:some/project cd project patch -p 0 < ~/temp.patch
Some of our repositories are mirrored on GitHub. See https://github.com/Magnolia/. These are copies (sometimes partial) of our canonical repositories. As such, pushing to GitHub will not work. Well, it will, but your changes will be overriden by the next push to the canonical repository.
If the connection test showed you a line like
C R W user/jdoe/.*, you have the possibility to create your own repositories.
To start a new one, just do
# HTTPS: git clone https://git.magnolia-cms.com/user/jdoe/mynewrepo # SSH: git clone email@example.com:user/jdoe/mynewrepo
If you already have a local repository, you can push to this new one with
git remote add origin firstname.lastname@example.org:user/jdoe/mynewrepo git push --all origin git push --tags origin
Note that the
origin name is completely arbitrary and up to you. You can use any descriptive name you like.
origin is the default in git, so it's generally good practice to keep this name for the canonical, i.e "origin" repository.
To start a new repository with the https protocol the commands are as follows:
git clone https://git.magnolia-cms.com/path/to/repository git remote add origin https://git.magnolia-cms.com/path/to/repository
Sharing your user repository
If you create a user repository as above and want to get other people to read or write to it, see http://gitolite.com/gitolite/g2/setperms.html
READERS, which are arbtitrary "roles" that we added in Gitolite for user repos; usernames are LDAP UIDs. (http://gitolite.com/gitolite/g2/user.html#user_set_get_additional_permissions_for_repos_you_created_)
# See current perms ssh email@example.com getperms <repo-path> # Setup one committer echo "WRITERS <username>" | ssh firstname.lastname@example.org setperms <repo-path> # Note that the above wiped out any WRITERS and READERS that this repository had previously, except those configured in Gitolite itself; use your bash-fu to _add_ users
echo "WRITERS mgeljic READERS gjoseph pmundt" | ssh email@example.com setperms user/ejervidalo/amplify/events-showcase.git
At the moment, Pete Ryland, Philip Mundt and Grégory Joseph have administrative access to the Git server. So contact either of us to create repositories or user accounts.
For details on our setup, see the Git page in Systems & Infrastructure space.
Tips, tricks and other troubleshooting