git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git aliases executed from wrong dir

From
Kevin Ballard <kevin@sb.org>
Date
Jun 25, 2008, 23:49 UTC
Message-ID
<E9A68D2F-10AD-4779-AACB-6152A38D37C5@sb.org>
In-Reply-To
<9777229F-27FD-4CB2-A5C7-6CA15733B8D2@sb.org>

To clarify, this only appears to affect shell aliases (i.e. ones that start with !).

   git config alias.foo 'ls-files'
Works fine from a subdir
   git config alias.foo '!git ls-files'
Doesn't behave right from a subdir.
-Kevin Ballard
On Jun 25, 2008, at 4:44 PM, Kevin Ballard wrote:
Show 17 quoted lines
> If I create an alias with `git config alias.foo '!pwd'` and then run  
> it from a subdirectory of my repo, it prints out the root of my  
> repo. This prevents the ability to create aliases that take  
> filenames, as they simply won't work if you try and reference a file  
> from a subdirectory.
>
> -- 
> Kevin Ballard
> http://kevin.sb.org
> kevin@sb.org
> http://www.tildesoft.com
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Kevin Ballard
http://kevin.sb.org
kevin@sb.org
http://www.tildesoft.com
Previous: Kevin BallardNext: Jānis Rūcis
Message 2 of 3 in “Git aliases executed from wrong dir”
  1. Kevin BallardJun 25, 2008
  2. Kevin BallardJun 25, 2008
  3. Jānis RūcisAug 16, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.