프로젝트를 정리하다가 갑자기 특정 repository에서 button
이라는 코드가 들어간 파일을 찾고자 했다.
물론 프로젝트를 클론받아서 찾는 방법도 있지만, 클론받아서 고칠게 있는 것이 아니라 단순히 궁금해서 찾아본 거라서 클론까지 갈 필요가 없다고 생각했다. 그래서 구글링하다가 깃허브에서 검색하는 구문에 대해서 알게되었다.
해결해야할 상황
깃허브에서 repository에서 button이라는 단어가 들어간 파일을 다 찾고 싶음!
해결방법
1. 찾아야되는 repository에 들어가서 빨간상자에 있는 검색창을 이용한다.

2. 검색창에 아래와 같은 형식을 이용해서 검색한다.
repo:<깃헙아이디>/<repo명> <찾는 단어>
예를 들어 내 아이디가 Id
이고, 탐색할 repository는 ABCDE
, 찾아야할 단어는 button
라면 아래와 같이 쓰면 된다.
repo:Id/ABCDE button
그런데 사실 해당 레포지토리에 들어가 1번 사진의 검색창을 누르면 이미 repo 부분은 형성이 되어있다.
즉, 그냥 검색어만 입력하면 된다.
3. 결과

그럼 위와 같이 결과가 잘 나오는 것을 볼 수 있다.
똑같이 했는데 안 된다?

깃허브에 의하면 그렇다고 한다. 그렇다면 클론을 받아서 검색하자!
참고
https://docs.github.com/ko/search-github/github-code-search/about-github-code-search
GitHub 코드 검색 정보 - GitHub Docs
GitHub code search lets you rapidly search, navigate and understand your code, your team's code, and the code of the open source community. This search engine is designed to be scalable, code-aware, and support searching code across GitHub using regular ex
docs.github.com
https://docs.github.com/en/search-github/github-code-search/understanding-github-code-search-syntax
Understanding GitHub Code Search syntax - GitHub Docs
The search syntax in this article only applies to searching code with GitHub code search. Note that the syntax and qualifiers for searching for non-code content, such as issues, users, and discussions, is not the same as the syntax for code search. For mor
docs.github.com
'💻개발 > Git' 카테고리의 다른 글
[Git]여러 repository 한 개로 합치기! (0) | 2024.02.02 |
---|---|
git fetch --prune : Remote에 없는 브랜치 Local에 반영 (4) | 2024.01.11 |
프로젝트를 정리하다가 갑자기 특정 repository에서 button
이라는 코드가 들어간 파일을 찾고자 했다.
물론 프로젝트를 클론받아서 찾는 방법도 있지만, 클론받아서 고칠게 있는 것이 아니라 단순히 궁금해서 찾아본 거라서 클론까지 갈 필요가 없다고 생각했다. 그래서 구글링하다가 깃허브에서 검색하는 구문에 대해서 알게되었다.
해결해야할 상황
깃허브에서 repository에서 button이라는 단어가 들어간 파일을 다 찾고 싶음!
해결방법
1. 찾아야되는 repository에 들어가서 빨간상자에 있는 검색창을 이용한다.

2. 검색창에 아래와 같은 형식을 이용해서 검색한다.
repo:<깃헙아이디>/<repo명> <찾는 단어>
예를 들어 내 아이디가 Id
이고, 탐색할 repository는 ABCDE
, 찾아야할 단어는 button
라면 아래와 같이 쓰면 된다.
repo:Id/ABCDE button
그런데 사실 해당 레포지토리에 들어가 1번 사진의 검색창을 누르면 이미 repo 부분은 형성이 되어있다.
즉, 그냥 검색어만 입력하면 된다.
3. 결과

그럼 위와 같이 결과가 잘 나오는 것을 볼 수 있다.
똑같이 했는데 안 된다?

깃허브에 의하면 그렇다고 한다. 그렇다면 클론을 받아서 검색하자!
참고
https://docs.github.com/ko/search-github/github-code-search/about-github-code-search
GitHub 코드 검색 정보 - GitHub Docs
GitHub code search lets you rapidly search, navigate and understand your code, your team's code, and the code of the open source community. This search engine is designed to be scalable, code-aware, and support searching code across GitHub using regular ex
docs.github.com
https://docs.github.com/en/search-github/github-code-search/understanding-github-code-search-syntax
Understanding GitHub Code Search syntax - GitHub Docs
The search syntax in this article only applies to searching code with GitHub code search. Note that the syntax and qualifiers for searching for non-code content, such as issues, users, and discussions, is not the same as the syntax for code search. For mor
docs.github.com
'💻개발 > Git' 카테고리의 다른 글
[Git]여러 repository 한 개로 합치기! (0) | 2024.02.02 |
---|---|
git fetch --prune : Remote에 없는 브랜치 Local에 반영 (4) | 2024.01.11 |