:::: MENU ::::

Prevent Git history re-writes with denyNonFastForwards on GitHub & BitBucket

As you may know, I’m (still) in love with Git. One of the reasons is it’s power, but, occasionally, that power allows you to shoot the rest of your team in the chest. Or delete their commits and wipe them from history (which feels about the same).

You can do this by forcing your pushes upon other git servers, using git push -f. As #git IRC‘s resident bot says, this is a bad idea:

Rewriting public history is not recommended. Everyone who has pulled the old history have to do work (and you’ll have to tell them to), so it’s infinitely better to just move on. If you must, you can use `git push -f <remote> <branch>` to force (and the remote may reject that, anyway). See http://goo.gl/waqum

It continues:

[!force_push] If you need to overwrite the history of a remote git repository (very bad idea, see !rewrite), you can do so with `git push -f`.  Note the remote server may reject this.  See man git-config and search for receive.denyNonFastForwards.  Best practice is for upstream servers to denyNonFastForwards.

If you don’t want team members to be able to rewrite time and wipe away a combined team’s work at the same time, you can do as the computer tells you and configure NonFastForwards by executing the following on your git staging server:

git config recieve.denyfastforwards true

That will tell the server to refuse receipt of commits that do not follow naturally from commits already received.

What if you don’t have access to the remote server directly however? Fear not, it’s still possible.

BitBucket

Thankfully this features was added in 2013, and you can configure it as administrator of a repository via the web interface.

  1. Log in
  2. Go to your repository URL (or click on the repository name). E.g. https://bitbucket.org/your-repo
  3. Click on “Settings” at the bottom of the left NavBar
  4. Click on “Branch Management”, under “Settings”, submenu “General”
  5. Find “Prevent history re-writes (rebase) on these branches”, type “master” into the field below it, and click “Add”

GitHub

Although GitHub currently provides no public interface for this functionality, it is apparently possible by contacting GitHub support directly and asking for the option to be set.

Do you know how to set this using GitLab? Share your how-tos for other platforms in the comments.



PHPList API sprint: results

The last two days I’ve been sprint-hacking the PHPList public API. What is PHPList, why an API, and what is a sprint-hack, you may ask. The first is a Free Software MailChimp competitor established 10 years ago, and available to install or use as a service. The second is for calling PHPList actions remotely (such as sending a newsletter), and for easy integration with other apps and websites. The third I guess you know: a hacking sprint is a short burst of effort to write or improve a project, typically (but not always) code.

PHPList logo

Continue Reading



Backup multiple email accounts automatically on Linux

ball of emails

I launched a new personal website last week, and changed my domain registrar and hosting company in the process. Being concerned how this would affect my primary email account (mail at samtuke dot com), and keen not to lose any of the 10.000+ messages that are stored there, I set about backing them up to a local folder. I also have an ancient Hotmail account, dating from 1997, containing all sorts of childhood contacts and life affecting discussions, and since Microsoft finally decided to allow users gratis use of the IMAP protocl, I decided to back up both email accounts to save time. Continue Reading


Get ArkOS up and running on Ubuntu in a virtual machine

So you’ve heard about the plucky new all-in-one host-it-yourself Linux distribution that’s turning Raspberry Pi’s into Freedom Boxes? ArkOS is a nifty little Arch Linux spin-off with slick marketing and granny-friendly interface. Yes it runs owncloud, dovecot, XMPP, transmission, and many more. Fortunately you don’t need a Raspberry Pi to give it a spin: here’s how to run it on Ubuntu machines. Continue Reading


What Heartbleed means for Free Software

The bug in OpenSSL nicknamed “heartbleed” that was discovered this week has been labelled “catastrophic“, “11 out of 10” for seriousness, and credited with “undoing web encryption“. It reached the height of mainstream press yesterday with dedicated front page articles on The Guardian and and The New York Times. This Free Software bug is now known worldwide and is set to remain infamous for years to come. So what does all this mean for the reputation of Free Software? Continue Reading



Fix missing maps on Drupal 7 with Open Layers and SSL

Open Layers are great, Drupal are great, and the OpenLayers and associated Drupal modules that combine the two are especially great. Unless, like most modern security-conscious websites, you’re using encrypted connections to your server with SSL. In that case, maps are unfortunately invisible wherever they’re used, both on public pages, and in administrative and content editing pages. Continue Reading


Thoughts on marketing the ‘Improv’ board

At the end of last month KDE announced a new Open Hardware project to create a Raspberry Pi-like computer called “Improv“, produced by “Make Play Live” of Coherent Theory LLC. This is an important development that I’m delighted to see, and I plan to pre-order and get mine in March.

Marketing Free Software and Open Hardware based products, and specifically marketing to Free Software communities, is a fascinating and complex challenge. Let’s see if we can learn something from observing the journey of Make Play Live’s new product. Continue Reading


Pages:1234567