简体   繁体   中英

File search across all Git projects

I am trying to search for a specific file extensions across all Git remote projects for the master branch.

Is there any command for it? Cloning all projects locally will take lot of time.

Unfortunately not, you have to rely on the tools provided by your host platform: Gitlab, Github or whatever.

As an alternative, you should build a list of your remote repo then remotely search by:

git log origin/master ...search options...

Both GitHub and GitLab have search functionality for this.

If you need a local/ git based solution, cloning the repo is probably your best bet, depending on what information you need from the repository contents. There is a tool called all-repos that helps you do this. It provides a minimal configuration for discovery and automation of working with many repos all at once. It also includes tools like all-repos-find-files , all-repos-grep , etc.

In TFS 2018, I found the search by using filter by scope(file:) option. It has all the necessary filters(eg Branch, repo). This solved my issue. Using the same search, I able to find the string within each file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM