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

Re: git locate

From
SNSungHyun Nam <goweol@gmail.com>
Date
Jan 21, 2010, 00:11 UTC
Message-ID
<4B579BA8.8050000@gmail.com>
In-Reply-To
<alpine.DEB.1.00.1001201021060.31129@intel-tinevez-2-302>
Hello,
Johannes Schindelin wrote:
Show 19 quoted lines
>
> On Tue, 19 Jan 2010, Jakub Narebski wrote:
>
>> Johannes Schindelin<Johannes.Schindelin@gmx.de>  writes:
>>
>>> On Wed, 20 Jan 2010, John Tapsell wrote:
>>>
>>>>    Could we add a:  git locate<filename>        or git find<filename>
>>>
>>> How about "git ls-files \*<filename>"?
>>
>> Or "git ls-files '*filename'...
>>
>> ... but how to make an (git) alias for this?
>
> Add something like this to your $HOME/.gitconfig:
>
> [alias]
>          locate = !sh -c 'git ls-files "\\*$1"' -

The alias 'git locate' and the command 'git ls-files' runs differently if I run them in a subdirectory. Is it expected?

[master] ~/srcs/git[299]$ git locate urls.txt Documentation/urls.txt [master] ~/srcs/git[300]$ git ls-files '*urls.txt' Documentation/urls.txt [master] ~/srcs/git[301]$ cd t [master] ~/srcs/git/t[302]$ git locate urls.txt Documentation/urls.txt [master] ~/srcs/git/t[303]$ git ls-files '*urls.txt' [master] ~/srcs/git/t[304]$

Thanks, namsh

Previous: Johannes SchindelinNext: Michael J Gruber
Message 8 of 17 in “git locate”
  1. John TapsellJan 20, 2010
  2. Johannes SchindelinJan 20, 2010
  3. Jakub NarebskiJan 20, 2010
  4. Johannes SchindelinJan 20, 2010
  5. Jakub NarebskiJan 20, 2010
  6. John TapsellJan 20, 2010
  7. Johannes SchindelinJan 20, 2010
  8. SungHyun NamJan 21, 2010
  9. Michael J GruberJan 21, 2010
  10. Štěpán NěmecJan 21, 2010
  11. Sverre RabbelierFeb 15, 2010
  12. John TapsellJun 2, 2010
  13. John TapsellJun 2, 2010
  14. Bruce StephensJun 2, 2010
  15. Matthieu MoyJun 2, 2010
  16. Clemens BuchacherJun 3, 2010
  17. Nguyen Thai Ngoc DuyJun 2, 2010

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.