git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Koch <thomas-5j3myg3OO4w@public.gmane.org>
To: "git-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<git-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"vcs-home"
	<vcs-home-qhrM8SXbD5JdXEZaVTQqel6hYfS7NtTn@public.gmane.org>
Subject: cdgit: cd relative to git workdir root
Date: Mon, 16 Sep 2013 21:01:14 +0200	[thread overview]
Message-ID: <201309162101.14879.thomas@koch.ro> (raw)

Hi,

I frequently have the need to cd back to the root of the current git workdir 
and created to alias for this:

git alias root = rev-parse --show-toplevel

shell alias cdgit = cd $(git root)

Maybe somebody likes this.

Now it would be cool, to have an alias to cd into a specific subdir of the git 
worktree and have zsh (or bash) auto completion for this like

git clone git://git.kernel.org/pub/scm/git/git.git
cd git/gitweb/static/js/lib (just to be somewhere deep)
cdgit con<tab>/com<tab> (becomes: cdgit contrib/completion)

Somebody with zsh/bash skills who already did this?

Regards, Thomas Koch

             reply	other threads:[~2013-09-16 19:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 19:01 Thomas Koch [this message]
2013-09-16 19:25 ` cdgit: cd relative to git workdir root Adam Spiers
     [not found] ` <201309162101.14879.thomas-5j3myg3OO4w@public.gmane.org>
2013-09-17  5:33   ` martin f krafft

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=201309162101.14879.thomas@koch.ro \
    --to=thomas-5j3myg3oo4w@public.gmane.org \
    --cc=git-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=vcs-home-qhrM8SXbD5JdXEZaVTQqel6hYfS7NtTn@public.gmane.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).