Archive for August, 2008

Git - trailing whitespace FIX

Monday, August 25th, 2008

vi .git/hooks/pre-commit

Delete following lines from pre-commit perl cript
if (/\s$/) {
bad_line(”trailing whitespace”, $_);
}

Git - automate

Wednesday, August 20th, 2008

#!/bin/sh

WHO=`whoami`
DIR=`pwd`
cd $DIR

echo "/usr/local/bin/git commit -m \"$(date +"%Y-%m-%d %T") user=$WHO\" -i *"
/usr/local/bin/git commit -m "$(date +"%Y-%m-%d %T") user=$WHO" -i *

Git - branching and merging

Wednesday, August 20th, 2008

git checkout -b mybranch
git checkout master
cat .git/HEAD
git branch

echo “Lots of fun” >> example.txt
git commit -m “Some fun.” -i example.txt
git merge -m “Merge work in mybranch” mybranch

Git useful commands

Wednesday, August 20th, 2008

git-init
git add .

git remote add xapian git://pacific-design.com:/repo.git
git fetch pacific-design.com:/repo
git-push –all –repo=all -f pacific-design.com:/repo

git-update-index –add file1.pl file2.pl
ls .git/objects/??/*
git-cat-file -t 557db03de997c86a4a028e1ebd3a1ceb225be238
git-cat-file “blob” 557db03
git-diff-files
git-write-tree
git-update-index file1.pl
git commit
git-diff-tree -p HEAD
git log
git-whatchanged -p
git tag my-first-tag
git diff my-first-tag
git tag -s

1. git-read-tree –reset HEAD
2. git-update-index –refresh
3. git reset