developing smarter web applications...

Git

Git branches to manage third party app customization

Preface:

I have been using this technique to customize different types of third party projects for years. I originally wrote about it back in 2009 in this popular post regarding the management of customizations on top of the ever changing Drupal code base. That post is very long winded and overly technical for most people, this post will serve as an abridged version covering only the branching concept.

Using a 1and1 git repository

On the 1and1 business accounts you can now use Git via SSH. Here is how...

Setup your master FTP password (which will be used for SSH).

SSH into your 1and1 account with (assuming example.com is on this account):
ssh username@example.com
mkdir repositories
cd repositories
git init --bare my_repo.git

Now on your local machine you can clone this repository with:
git clone ssh://username@example.com/~/repositories/my_repo.git

Or to add 1and1 as a remote location for an existing repository do:

Secure push and pull with git-http-backend

I am setting up a new repository machine for my code. I will be setting it up with Active Directory later on, but I figured my basic setup would be a good starting point for most people.

My new repo box is on CentOS. I installed Git on my server from the EPEL repository. All the commands in this tutorial will be done from sudo.

I created a simple password file on my server using this command.
htpasswd -c path/to/file/passwords user-name

To add a user to the existing password file do:

Delete a remote branch in Git

I run into this all the time. I am typing too fast when I push code to my remote repository and I make a typo that creates a new branch in my remote repository.

Correct: git push origin production:refs/heads/production

Mistake: git push origin production:ref/heads/production
Result: * [new branch]    production -> ref/heads/production

Obviously I do not want this new branch on my remote server, so I want to remove it. You can remove this newly created branch with.

Manage and deploy Drupal code securely with Git, gitosis and Capistrano

UPDATE 2: I have written a follow-up article which simply covers the branching technique described in this post.

UPDATE: I am now using git-http-backend instead of Gitosis. I made the switch because I needed a more central location for managing our projects. I have not written about it yet, but this new approach allows me to authenticate via an LDAP/Active Directory type service.

Debian Rails Stack - NginX and Mongrel

If you are reading this it is because you already know that you want a Rails setup on a Debian server with NginX in front of a Mongrel Cluster.

These are the steps I used to completely set up my server...

Dead simple GIT install on Mac

Git is the new cool kid in town when it comes to source code management. I wanted to install Git on my Mac, but I had heard installing it could be a bit of a pain. I did a bunch of research before I tried an install and it seemed Macports would be the easiest way to get it working.

 
Syndicate content