git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: david@gibson.dropbear.id.au
Cc: Git Mailing List <git@vger.kernel.org>
Subject: git-switch-tree script
Date: Mon, 23 May 2005 03:24:22 -0400	[thread overview]
Message-ID: <42918526.1060406@pobox.com> (raw)

[-- 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


                 reply	other threads:[~2005-05-23  7:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42918526.1060406@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).