
๐งฌ Git ์ ์ฅ์์์ ๊ธฐ์ฌ์ ์ ๋ณด ์ถ์ถ ๋ฐ ๋ถ์
Git ๋ฆฌํฌ์งํ ๋ฆฌ์ GitHub์์ ์ ์(์ด๋ฆ, ์ด๋ฉ์ผ, ์๋ก ๊ด๋ จ ์์ด ๋ณด์ด๋ ๊ณ์ ๊ฐ์ ์ฐ๊ฒฐ)์ ์ถ์ถํ๋ OSINT ๋๊ตฌ์ ๋๋ค.
gitcolombo.py) โ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ํด๋ก ํ๊ณ git log๋ฅผ ํ์ํ๋ฉฐ, ๋ ํ๋ถํ ์ ํธ๋ฅผ ์ํด GitHub API๋ฅผ ํธ์ถํ ์ ์์ต๋๋ค.gitcolombo.html) โ ๋จ์ผ ์ ์ HTML ํ์ผ; ๋ธ๋ผ์ฐ์ ์์ ์ด๊ณ GitHub API๋ฅผ ์ง์ ์ฟผ๋ฆฌํ๋ฉฐ, ์ค์น๊ฐ ํ์ ์์ต๋๋ค.๊ฐ ์ด๋ฉ์ผ/์ด๋ฆ์ด ์ด๋์ ์ค๋์ง(PGP ํค, ๊ณต๊ฐ ์ด๋ฒคํธ, ์ปค๋ฐ ๊ฒ์, ์ปค๋ฐ ๋ฉ์์ง ํธ๋ ์ผ๋ฌ ๋ฑ)์ ๋ํ ์ ์ฒด ์ค๋ช ์ docs.md ๋ฅผ ์ฐธ์กฐํ์ธ์.
https://gitcolombo.soxoj.com ์์ ํธ์คํ
๋๊ฑฐ๋, ๋ก์ปฌ์์ gitcolombo.html์ ์ด ์ ์์ต๋๋ค. ๋ธ๋ผ์ฐ์ ์์ ์ง์ GitHub API๋ฅผ ์ฟผ๋ฆฌํ๋ ๋จ์ผ ์ ์ HTML ํ์ผ์
๋๋ค. ์ค์น๋, ๋ฐฑ์๋๋ ํ์ ์์ต๋๋ค.
Python 3.10 ์ด์๊ณผ ์๋ํ๋ git ๋ฐ์ด๋๋ฆฌ๊ฐ ํ์ํฉ๋๋ค. ํ์ฌ Python ์ข
์์ฑ์ ์์ต๋๋ค.
pip install gitcolombo
๋๋ ์์ค์์:
git clone https://github.com/Soxoj/gitcolombo
cd gitcolombo
pip install -e .
# ๋ชจ๋ git URL์์
gitcolombo -u https://github.com/Soxoj/maigret
# ๋ก์ปฌ ๋๋ ํ ๋ฆฌ์์ ์ฌ๊ท์ ์ผ๋ก
gitcolombo -d ./maigret -r
# GitHub ์ฌ์ฉ์/์กฐ์ง์ ๋ชจ๋ ๊ณต๊ฐ ๋ฆฌํฌ์งํ ๋ฆฌ ํด๋ก ๋ฐ ์ค์บ
gitcolombo --nickname octocat
# API ์ ์ฉ: GitHub ์ฌ์ฉ์ ์ด๋ฆ์ ๋ํ ์ด๋ฉ์ผ์ ํด๋ก ์์ด ์ฐพ๊ธฐ
gitcolombo --search Soxoj
# ์๊ฒฉ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ํด๋ก ํ ์์น ๋ณ๊ฒฝ (๊ธฐ๋ณธ๊ฐ: ./repos)
gitcolombo -u https://github.com/Soxoj/maigret --repos-dir ./clones
python -m gitcolombo ๋ ๋์ผํ๊ฒ ์๋ํ๋ฏ๋ก, ์คํฌ๋ฆฝํธ๋ฅผ $PATH์ ๋ฃ์ง ์์๋ ๋ฉ๋๋ค.
์๊ฒฉ ๋ฆฌํฌ์งํ ๋ฆฌ๋ ๊ธฐ๋ณธ์ ์ผ๋ก ./repos/์ ํด๋ก ๋๋ฉฐ, --repos-dir๋ก ์ฌ์ ์ํ ์ ์์ต๋๋ค. GitLab ๋ฐ Bitbucket ๊ทธ๋ฃน์์ ๋ฐฐ์น ํด๋ก ํ๋ ค๋ฉด ghorg๋ฅผ ์ฌ์ฉํ์ธ์.
๊ฐ๋ฐ์๋ ์ข
์ข
ํ ์ ์(์: ์
๋ฌด ๊ณ์ )์ผ๋ก ์ปค๋ฐํ ๋ค์ ๋ค๋ฅธ ์ ์(์: ๊ฐ์ธ ๊ณ์ )์ผ๋ก ์ ํํ๊ณ git commit --amend๋ฅผ ์คํํฉ๋๋ค. ์ด๋ ์ปค๋ฏธํฐ๋ ๋ค์ ์ฐ์ฌ์ง์ง๋ง ์๋ ์์ฑ์๋ ๊ทธ๋๋ก ๋จ๋๋ค๋ ์ฌ์ค์ ์์ต๋๋ค. ๋ ์ญํ ์ด ๋ถ๋ฆฌ๋๊ณ , ๊ทธ ๋ถ์ผ์น๋ฅผ gitcolombo๊ฐ ์ ํํ ์๊ด์ํต๋๋ค.
์์ฑ์์ ์ปค๋ฏธํฐ์ ์ฐจ์ด์ ๋ํ ๊ฐ๋จํ ์ค๋ช : https://stackoverflow.com/questions/18750808/difference-between-author-and-committer-in-git
ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ ์ฉ ํ
์คํธ ์ค์ํธ โ ํ์ฌ ์ข
์์ฑ ์์. ๋ฆฌํฌ์งํ ๋ฆฌ ๋ฃจํธ์์ (pip install -e . ์ดํ):
python3 -m unittest test_gitcolombo -v
์ข
๋จ ๊ฐ ํ
์คํธ๋ ์์ ๋๋ ํฐ๋ฆฌ์ ์ค์ git ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ์์ฑํ๋ฏ๋ก, ์๋ํ๋ git ๋ฐ์ด๋๋ฆฌ๊ฐ ํ์ํฉ๋๋ค(git์ด ์์ผ๋ฉด ํ
์คํธ๊ฐ ๊ฑด๋๋๋๋ค).
ํ
์คํธ๋ GitHub Actions(.github/workflows/tests.yml)๋ฅผ ํตํด ๋ชจ๋ ํธ์ ๋ฐ ํ ๋ฆฌํ์คํธ์์ Python 3.10โ3.13์ ๋ํด ์คํ๋ฉ๋๋ค.
[email protected], @users.noreply.github.com)