thefekete.net

$> :(){ :|:& };:

Initialize a remote git repository from an existing local repo

#!/bin/bash
REMOTE_HOST='example.com'
REMOTE_PORT=22
REPO_NAME='my_repository'

# create the bare remote repo
ssh $REMOTE_HOST -p$REMOTE_PORT \
"mkdir -p /var/git/$REPO_NAME.git && \
cd /var/git/$REPO_NAME.git && git init --bare" &&

# configure the local repo
git remote add origin ssh://$REMOTE_HOST:$REMOTE_PORT/var/git/$REPO_NAME.git &&
git config branch.master.remote origin &&
git config branch.master.merge refs/heads/master &&

# see if it worked...
git push origin master

Remove a remote branch in git

To remove a branch on a remote repository in git, use:

git push <remote-repo> :<branch-to-delete>

Using commit messages more effectively

When committing with git, you have to include a message. The standard one-liners can be useful to you or anybody else trying to make heads or tails of a particular commit. But what if you need more room than 80 characters? You can do that.

Read the rest of this entry »

git auto-readme hook script

Here’s a handy little script for your .git/hooks folder…

I’ve been getting into git and along with that, I’ve been trying to be more standards minded. Part of that entails including a LICENSE and README file. The LICENSE file is as ease as:

wget -q -O - http://www.gnu.org/licenses/gpl.txt > LICENSE

Its the README that can be a real pain. But, I found a way to make it a little easier.

Read the rest of this entry »

Added GitWeb to the site!

Check it out at http://thefekete.net/gitweb