All of lore.kernel.org
 help / color / mirror / Atom feed
* git-switch-tree script
@ 2005-05-23  7:24 Jeff Garzik
  0 siblings, 0 replies; only message in thread
From: Jeff Garzik @ 2005-05-23  7:24 UTC (permalink / raw)
  To: david; +Cc: Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 76 bytes --]

This is what I use to switch between branches, in my kernel trees.

	Jeff



[-- Attachment #2: git-switch-tree --]
[-- Type: text/plain, Size: 339 bytes --]

#!/bin/sh

if [ "x$1" != "x" ]
then
	if [ "$1" == "master" ]
	then
		( cd .git && rm -f HEAD && ln -s refs/heads/master HEAD )
	else
		if [ ! -f .git/refs/heads/$1 ]
		then
			echo Branch $1 not found.
			exit 1
		fi

		( cd .git && rm -f HEAD && ln -s refs/heads/$1 HEAD )
	fi
fi

git-read-tree -m HEAD && git-checkout-cache -q -f -u -a


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-23  7:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-23  7:24 git-switch-tree script Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.