Posts Tagged ‘git’

Version controlling WordPress themes on simple hosts

July 17th, 2010

Here’s a quick tip if your WordPress host is quite simple and only provides FTP access and no version control tools (svn, git) or specific syncing tools (rsync)

Use version control for the theme on your local machine (where you run your dev WordPress environment), then use syncing capability of FTP tool (Cyberduck for MacOSX has this feature) to promote the changes to your host.

Remember, version control is the only way to sensibly manage changes to your theme – editing through the WordPress theme editor on your host is a really bad way to manage it!

Git repositories with Slicehost

December 1st, 2009

No doubt I am really happy with my Slicehost VPS, it has been so hassle free!  The best part about Slicehost is all the amazing articles they provide to help you get going with your slice.

I’ve setup my slice to host my private git repositories, particularly since I wanted to use them with Rails and Capistrano.  This article provide to be just what I needed:

http://articles.slicehost.com/2009/5/13/capistrano-series-setting-up-git

The article even shows you how to secure the shell that the git user has to avoid anyone SSHing into your box with their ID.  However, it doesn’t tell you what to do when you want to create another repository as you cannot switch to the git user while ever it is using the git-shell as opposed to a normal shell.  The trick is you need to switch with the root user as only they are allowed to provide an alternative shell.  Here are the commands once you have logged into your slice with a user that is able to sudo:

$ sudo su --shell /bin/bash git
$ cd /home/git
$ mkdir project2
$ cd project2
$ git --bare init
$ exit

Now your repository is good to go and you can follow the steps from “Making your first commit” section.

Git for dummies

January 31st, 2009

Only just started to finally get stuck into learning git. It certainly seems to be revolutionising the way we do version control. I’m pretty hooked on subversion and I have to admit, I thought that was as good as it gets! But the hype around git to much to ignore.

Here’s some resources I’ve found really useful to get (git) going:

Resources

  • GitCasts by Scott Chacon. Screencasts are for me one of the best ways to learn things, these casts, although very quick, give you that good leg up.
  • Git from the bottom up by John Wiegley. There is a link from his blog entry to a paper he has put together on his understanding of Git. Always good to read some theory!
  • Git – SVN crash course from the offical git site. A great place to start if like me, you’re already familiar with svn.
  • Github’s Git Cheat Sheet is a good resource too!

Accessing github from behind a proxy

January 2nd, 2009

If you’re behind a proxy which restricts outbound ports (i.e. only port 80 and 443), then you’ll be pleased to know that you can still access Github.

Rather than using the git:// protocol (defaulting to port 9418), you can use the HTTP protocol to do the same thing! Article on Github about it here.

git clone http://github.com/justinfrench/formtastic.git

It also works for Rails plugins!

script/plugin install http://github.com/justinfrench/formtastic.git

Don’t forgot you need to set environment variable http_proxy to tell Git to use the proxy or or can set it in git-config. The example below sets it at the global level:

git config --global --add http.proxy http://myproxy:8080