skip main content

Posts Tagged ‘github’

Setting up your own hosted private Git repository

posted by Duncan at 1:12 pm on May 6th, 2011

Now I’m a fully paid up user of Github. It’s a wonderful service, site and community of developers. But for the account plan I can afford, I only get 5 private repositories. I’m happy to make my work public, but there are some bits of software I want to keep private right now and yet still have remote copies of, and this comes to more that 5. I still want to use Git, and maybe one day make them public on Github. Here’s my solution using my own hosting as a private Git repository and just using Git and SSH to do the job.

Before we start, I’m assuming that you have SSH access to your hosting, and you have Git installed both on your machine and on the host.

First create a folder on your remote machine to hold the repos

$ ssh
$ mkdir git
$ exit

If you have the correct permission or sudo access you could do the same as me and create the dir at /opt/git. You’ll need to replace all other mentions of git with this new path if you go this route.

Navigate to the local git repos on your machine that you want to have a remote copy of. Running the command below will give you a bare copy of the repos in your tmp dir.

$ git clone --bare /path/to/myrepo/.git /tmp/myrepo.git

Now you need to get this copy onto your remote machine. There are various ways but the simplest is scp with the recursive flag set:

$ scp -r /tmp/myrepo.git

You have a couple of choices now. You can either just navigate in into your local git repos and add your remote git as a remote to your config like this:

$ git remote add myserver

or you can delete your old repos and check out the remote one. Make sure you backup the old one until you’re sure it works ok though.

$ git clone

You can now make changes and push them to your new remote repos when ever you want.

Hope this helps someone. It doesn’t solve everything, but is a simple way to have a private alternate copy of your Git repositories.

TweetMe – Another simple WordPress plugin that Twitters

posted by Duncan at 6:37 pm on January 24th, 2009

[UPDATE] Twitter have now turned of HTTP authentication which means until the plugin is updated to use the OAuth, it won’t work. I haven’t got time to update the plugin right now, but will when I do. In the mean while, the plugin code is available on github, so maybe someone else could add this support. Thanks.

[UPDATE] If you install my new revcanonical plugin, then TweetMe will use auto generated short urls from your own website, instead of going to a 3rd party site.

I’ve written a simple little WordPress Plugin to get me moving again. TweetMe posts a tweet to Twitter when you publish a blog post.


If you do a search on Google there are loads of similar plugins out there. The problem is after trying a few, none of them did what I wanted, and many of them seemed far to complex for the task in hand. I simply wanted this. Nothing more, nothing less:

  • I enter my Twitter credentials once and they get validated.
  • I decide how I want my tweet to look.
  • When I publish a new blog post, it gets sent to Twitter.
  • If I update that post, I don’t want it resent, unless I choose.
  • That’s it….

So that’s all TweetMe does.

back to the top