Skip to main content.
April 5th, 2011

Simple Checkout of phpMyAdmin with git

When setting up webservers for clients, I’ll usually configure and secure an installation of phpMyAdmin to allow them easy access to the MySQL database server.

I would also want to make sure it was easy to update that installation to the latest stable version. In the past this was easily done by initially checking out the STABLE tag from their Subversion repository using the following style command:

svn co https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/tags/STABLE/phpMyAdmin

and then when I wanted to update, it was a simple matter of running:

svn update

Well, the phpMyAdmin folks switched over to using git as their SCM system and unfortunately, they didn’t post any instructions on how a web server administrator who was never going to be changing/committing code back into the system would perform the same action using git. It took me about an hour of searching, reading, digesting how git works, cursing, but I finally came up with the following set of git commands necessary to checkout the STABLE branch of phpMyAdmin:

git clone --depth=1 git://github.com/phpmyadmin/phpmyadmin.git
cd phpmyadmin
git remote update
git fetch
git checkout --track -b PMASTABLE  origin/STABLE

…what that means is: clone the main repository from the specified path, drop into the newly created repository directory and thirdly create a new branch in the local repository called PMASTABLE that will track the remote repository’s branch called “origin/STABLE”.

The “depth=1″ parameter tells git not to copy a huge set of changes, but only the most recent set.

So, from here on, I should be able to merely run: “git pull” on that repository and it should update it to the latest STABLE.

Hopefully, others will find this useful.

UPDATE – Mar 13, 2014
I updated the above commands to show the correct GitHub URL and two more commands to make sure the local repo sees the STABLE branch before trying to create a local branch.

Posted by Brian Blood in Database, MySQL, php, Servers, Web App Development, Web Software

5 Comments »

This entry was posted on Tuesday, April 5th, 2011 at 9:24 pm and is filed under Database, MySQL, php, Servers, Web App Development, Web Software. You can follow any responses to this entry through the comments RSS 2.0 feed. You can leave a response, or trackback from your own site.

5 Responses to “Simple Checkout of phpMyAdmin with git”

  1. ian.c says:

    Thanks for posting this – very helpful!

    I was having a lot of trouble using git to upgrade phpMyAdmin. However, this post has made the process very simple.

  2. ceres says:

    Hello, the current URL for the phpMyAdmin repository is now git://github.com/phpmyadmin/phpmyadmin.git . The URL above does not work anymore.

    PS: Maybe you can post a possibility how to “convert” and existing phpmyadmin-system from old git-url to new git-url so you don’t have to checkout everything from beginning.

  3. Setting up a phpMyAdmin auto-update | Christian's blog says:

    [...] the guy over at Network Jack wrote down what I had already been [...]

  4. Bookmarks for 11月 21st through 11月 27th says:

    [...] Network Jack » Blog Archive » Simple Checkout of phpMyAdmin with git – – server php phpmyadmin howto tips hack [...]

  5. git update phpmyadmin « Linux T&T says:

    [...] source Author: WladyX on 14 December, 2012 Category: Apache Older: mount root fs and chroot [...]

Leave a Reply

You must be logged in to post a comment.