agentsclimarketplace

Git

Skill DaleStudy/skills/skills/git

๐Ÿ› ๏ธ ์—์ด์ „ํŠธ ์Šคํ‚ฌ

Install
npx -y skills add DaleStudy/skills --skill git

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Git ๋ฒ„์ „ ๊ด€๋ฆฌ ๋ชจ๋ฒ” ๊ด€๋ก€ ๋ฐ ์›Œํฌํ”Œ๋กœ์šฐ ๊ฐ€์ด๋“œ. ๋‹ค์Œ ์ƒํ™ฉ์—์„œ ์‚ฌ์šฉ: (1) Git ์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€ ์ž‘์„ฑ ์‹œ (Conventional Commits ๊ทœ์น™ ์ ์šฉ), (2) ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ ๋ฐ ๊ด€๋ฆฌ ์‹œ (GitHub Flow ๊ธฐ๋ฐ˜), (3) PR ์ƒ์„ฑ ๋ฐ ๋ณ‘ํ•ฉ ์ „๋žต ์„ ํƒ ์‹œ, (4) Git ํžˆ์Šคํ† ๋ฆฌ ์ •๋ฆฌ ์ž‘์—… ์‹œ (rebase, squash, cherry-pick), (5) Merge conflict ํ•ด๊ฒฐ ์‹œ, (6) 'git', '.git', 'commit', 'branch', 'merge', 'rebase' ํ‚ค์›Œ๋“œ๊ฐ€ ํฌํ•จ๋œ ์ž‘์—… ์‹œ

The file declares its own license as MIT. That is the authorโ€™s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

12.5 KB, as published. Nobody here has run it

Git

Git ๋ฒ„์ „ ๊ด€๋ฆฌ ๋ชจ๋ฒ” ๊ด€๋ก€ ๋ฐ ์›Œํฌํ”Œ๋กœ์šฐ ๊ฐ€์ด๋“œ.

์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€ ์ปจ๋ฒค์…˜

Conventional Commits ์‚ฌ์šฉ

์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€๋Š” <type>: <description> ํ˜•์‹์„ ๋”ฐ๋ฅธ๋‹ค:

feat: add form validation to login page
fix: prevent duplicate email check error on signup
docs: add installation guide to README
refactor: extract auth logic into separate module
test: add payment feature tests
chore: update dependencies

์ฃผ์š” ํƒ€์ž…

ํƒ€์ž…์„ค๋ช…์˜ˆ์‹œ
feat์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€feat: add dark mode support
fix๋ฒ„๊ทธ ์ˆ˜์ •fix: prevent token deletion on logout
docs๋ฌธ์„œ ๋ณ€๊ฒฝ (์ฝ”๋“œ ๋ณ€๊ฒฝ ์—†์Œ)docs: update API documentation
style์ฝ”๋“œ ํฌ๋งทํŒ…, ์„ธ๋ฏธ์ฝœ๋ก  ๋ˆ„๋ฝ (๋™์ž‘ ๋ณ€๊ฒฝ X)style: apply ESLint rules
refactor๋ฆฌํŒฉํ† ๋ง (๊ธฐ๋Šฅ ๋ณ€๊ฒฝ ์—†์Œ)refactor: extract utility functions
testํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€/์ˆ˜์ •test: add login API tests
chore๋นŒ๋“œ, ์„ค์ • ๋ณ€๊ฒฝ (src ๋ณ€๊ฒฝ ์—†์Œ)chore: update Webpack config
perf์„ฑ๋Šฅ ๊ฐœ์„ perf: implement lazy loading for images

์ƒ์„ธ ํ˜•์‹ (์„ ํƒ์‚ฌํ•ญ)

<type>(<scope>): <subject>

<body>

<footer>

์˜ˆ์‹œ:

feat(auth): implement JWT-based authentication

- Issue access and refresh tokens
- Store refresh tokens in Redis
- Add token renewal API endpoint

Closes #123

์ž์ฃผ ํ•˜๋Š” ์‹ค์ˆ˜

# โŒ ํƒ€์ž… ๋ˆ„๋ฝ
git commit -m "bug fix"

# โŒ ๋ชจํ˜ธํ•œ ์„ค๋ช…
git commit -m "fix: fix issue"

# โŒ ํ•œ ์ปค๋ฐ‹์— ์—ฌ๋Ÿฌ ์ž‘์—…
git commit -m "feat: implement login, signup, and password reset"

# โœ… ๋ช…ํ™•ํ•˜๊ณ  ๋‹จ์ผ ์ฑ…์ž„
git commit -m "feat: add form validation to login page"

์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€ ์ž‘์„ฑ ๊ฐ€์ด๋“œ๋ผ์ธ

  1. ์ฒซ ์ค„์€ 50์ž ์ด๋‚ด - ๊ฐ„๊ฒฐํ•œ ์š”์•ฝ
  2. ํ˜„์žฌํ˜• ์‚ฌ์šฉ - "added" (X) โ†’ "add" (O)
  3. ๋ช…๋ นํ˜• ์–ด์กฐ - "adds" (X) โ†’ "add" (O)
  4. ์ฒซ ๊ธ€์ž ์†Œ๋ฌธ์ž - Feat: (X) โ†’ feat: (O)
  5. ๋งˆ์นจํ‘œ ๊ธˆ์ง€ - feat: add feature. (X) โ†’ feat: add feature (O)
  6. ๋ณธ๋ฌธ์€ 72์ž๋งˆ๋‹ค ์ค„๋ฐ”๊ฟˆ - ๊ฐ€๋…์„ฑ ํ–ฅ์ƒ
  7. Why > What - ๋ณ€๊ฒฝํ•œ ๋‚ด์šฉ๋ณด๋‹ค ๋ณ€๊ฒฝํ•œ ์ด์œ ๋ฅผ ์„ค๋ช…
  8. ์˜์–ด๋กœ ์ž‘์„ฑ - ๋ฆด๋ฆฌ์ฆˆ ๋…ธํŠธ ์ƒ์„ฑ ๋„๊ตฌ์™€์˜ ํ˜ธํ™˜์„ฑ์„ ์œ„ํ•ด

GitHub Flow ์›Œํฌํ”Œ๋กœ์šฐ

๋ธŒ๋žœ์น˜ ์ „๋žต

main (ํ•ญ์ƒ ๋ฐฐํฌ ๊ฐ€๋Šฅํ•œ ์ƒํƒœ)
โ”œโ”€โ”€ feature/login-form
โ”œโ”€โ”€ fix/payment-error
โ””โ”€โ”€ refactor/user-service

๊ธฐ๋ณธ ๋ธŒ๋žœ์น˜

์ƒˆ ์ €์žฅ์†Œ ์ƒ์„ฑ ์‹œ ๊ธฐ๋ณธ ๋ธŒ๋žœ์น˜๋Š” main์„ ์‚ฌ์šฉํ•œ๋‹ค (๊ณผ๊ฑฐ์˜ master ๋Œ€์‹ ):

# ์ƒˆ ์ €์žฅ์†Œ ์ดˆ๊ธฐํ™” ์‹œ main ๋ธŒ๋žœ์น˜๋กœ ์‹œ์ž‘
git init -b main

# ๋˜๋Š” ๊ธฐ์กด ์ €์žฅ์†Œ์—์„œ ๊ธฐ๋ณธ ๋ธŒ๋žœ์น˜ ๋ณ€๊ฒฝ
git branch -m master main
git push -u origin main

# Git ์ „์—ญ ์„ค์ • (๋ชจ๋“  ์ƒˆ ์ €์žฅ์†Œ์— ์ ์šฉ)
git config --global init.defaultBranch main

์ฐธ๊ณ : GitHub, GitLab, Bitbucket ๋“ฑ ๋Œ€๋ถ€๋ถ„์˜ Git ํ˜ธ์ŠคํŒ… ์„œ๋น„์Šค๋Š” 2020๋…„๋ถ€ํ„ฐ ๊ธฐ๋ณธ ๋ธŒ๋žœ์น˜๋ฅผ main์œผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.

๋ธŒ๋žœ์น˜ ๋„ค์ด๋ฐ

# ํ˜•์‹: <type>/<description>
feature/user-authentication
fix/header-layout-bug
refactor/payment-module
docs/api-documentation
test/user-service
chore/update-dependencies

์ž‘์—… ํ๋ฆ„

# 1. main์—์„œ ์ตœ์‹  ์ƒํƒœ ๋ฐ›๊ธฐ
git switch main
git pull origin main

# 2. ์ƒˆ ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ
git switch -c feature/dark-mode

# 3. ์ž‘์—… ํ›„ ์ปค๋ฐ‹
git add .
git commit -m "feat: add dark mode toggle button"

# 4. ์›๊ฒฉ ๋ธŒ๋žœ์น˜์— ํ‘ธ์‹œ
git push origin feature/dark-mode

# 5. GitHub์—์„œ PR ์ƒ์„ฑ
gh pr create --title "feat: add dark mode support" --body "..."

# 6. ์ฝ”๋“œ ๋ฆฌ๋ทฐ ํ›„ main์— ๋ณ‘ํ•ฉ (GitHub UI ๋˜๋Š” CLI)
gh pr merge <PR๋ฒˆํ˜ธ> --squash  # ๋˜๋Š” --merge, --rebase

# 7. ๋กœ์ปฌ main ์—…๋ฐ์ดํŠธ ๋ฐ ๋ธŒ๋žœ์น˜ ์‚ญ์ œ
git switch main
git pull origin main
git branch -d feature/dark-mode

PR ๋ณ‘ํ•ฉ ์ „๋žต

์ „๋žต์„ค๋ช…์–ธ์ œ ์‚ฌ์šฉ
Squash๋ชจ๋“  ์ปค๋ฐ‹์„ ํ•˜๋‚˜๋กœ ํ•ฉ์นจ๊ธฐ๋Šฅ ๋ธŒ๋žœ์น˜ (๊ถŒ์žฅ)
Merge๋ณ‘ํ•ฉ ์ปค๋ฐ‹ ์ƒ์„ฑ, ํžˆ์Šคํ† ๋ฆฌ ๋ณด์กด๋ฆด๋ฆฌ์Šค ๋ธŒ๋žœ์น˜
Rebase์„ ํ˜• ํžˆ์Šคํ† ๋ฆฌ ์œ ์ง€, ๋ณ‘ํ•ฉ ์ปค๋ฐ‹ X๊ฐ„๋‹จํ•œ ๋ณ€๊ฒฝ, ๊น”๋”ํ•œ ํžˆ์Šคํ† ๋ฆฌ
# Squash (๊ถŒ์žฅ - ๊ธฐ๋Šฅ ๋‹จ์œ„๋กœ ์ปค๋ฐ‹ ์ •๋ฆฌ)
gh pr merge 123 --squash

# Merge (ํžˆ์Šคํ† ๋ฆฌ ๋ณด์กด)
gh pr merge 123 --merge

# Rebase (์„ ํ˜• ํžˆ์Šคํ† ๋ฆฌ)
gh pr merge 123 --rebase

Git ํžˆ์Šคํ† ๋ฆฌ ๊ด€๋ฆฌ

Rebase

Interactive Rebase (์ปค๋ฐ‹ ์ •๋ฆฌ)

# ์ตœ๊ทผ 3๊ฐœ ์ปค๋ฐ‹ ์ˆ˜์ •
git rebase -i HEAD~3

# ์—๋””ํ„ฐ์—์„œ ๋ช…๋ น์–ด ์„ ํƒ
# pick   โ†’ ์ปค๋ฐ‹ ์œ ์ง€
# reword โ†’ ์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€ ์ˆ˜์ •
# edit   โ†’ ์ปค๋ฐ‹ ์ˆ˜์ •
# squash โ†’ ์ด์ „ ์ปค๋ฐ‹์— ํ•ฉ์นจ
# fixup  โ†’ ์ด์ „ ์ปค๋ฐ‹์— ํ•ฉ์นจ (๋ฉ”์‹œ์ง€ ์ œ๊ฑฐ)
# drop   โ†’ ์ปค๋ฐ‹ ์‚ญ์ œ

์˜ˆ์‹œ:

# Before
pick a1b2c3d feat: implement login feature
pick d4e5f6g fix: typo in variable name
pick g7h8i9j fix: rename variable for clarity

# After (squash ์‚ฌ์šฉ)
pick a1b2c3d feat: implement login feature
fixup d4e5f6g fix: typo in variable name
fixup g7h8i9j fix: rename variable for clarity

Rebase onto main (๋ธŒ๋žœ์น˜ ์ตœ์‹ ํ™”)

# 1. main ์ตœ์‹ ํ™”
git switch main
git pull origin main

# 2. feature ๋ธŒ๋žœ์น˜๋ฅผ main ์œ„๋กœ rebase
git switch feature/my-feature
git rebase main

# 3. ์ถฉ๋Œ ๋ฐœ์ƒ ์‹œ
# - ํŒŒ์ผ ์ˆ˜์ • ํ›„
git add .
git rebase --continue

# - rebase ์ทจ์†Œํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด
git rebase --abort

Cherry-pick (ํŠน์ • ์ปค๋ฐ‹๋งŒ ๊ฐ€์ ธ์˜ค๊ธฐ)

# ๋‹ค๋ฅธ ๋ธŒ๋žœ์น˜์˜ ์ปค๋ฐ‹ ํ•˜๋‚˜๋งŒ ์ ์šฉ
git cherry-pick <commit-hash>

# ์—ฌ๋Ÿฌ ์ปค๋ฐ‹ ์ ์šฉ
git cherry-pick <commit-hash1> <commit-hash2>

# ์ถฉ๋Œ ๋ฐœ์ƒ ์‹œ
git add .
git cherry-pick --continue

Commit Amend (๋งˆ์ง€๋ง‰ ์ปค๋ฐ‹ ์ˆ˜์ •)

# ๋งˆ์ง€๋ง‰ ์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€๋งŒ ์ˆ˜์ •
git commit --amend -m "fix: correct commit message"

# ๋งˆ์ง€๋ง‰ ์ปค๋ฐ‹์— ํŒŒ์ผ ์ถ”๊ฐ€
git add forgotten-file.ts
git commit --amend --no-edit

# โš ๏ธ ์ฃผ์˜: ์ด๋ฏธ pushํ•œ ์ปค๋ฐ‹์€ amend ๊ธˆ์ง€ (ํžˆ์Šคํ† ๋ฆฌ ๋ณ€๊ฒฝ๋จ)

Reset vs Revert

# Reset - ์ปค๋ฐ‹ ์ทจ์†Œ (ํžˆ์Šคํ† ๋ฆฌ ์‚ญ์ œ)
git reset --soft HEAD~1   # ์ปค๋ฐ‹๋งŒ ์ทจ์†Œ, ๋ณ€๊ฒฝ์‚ฌํ•ญ ์œ ์ง€
git reset --mixed HEAD~1  # ์ปค๋ฐ‹ + staging ์ทจ์†Œ, ๋ณ€๊ฒฝ์‚ฌํ•ญ ์œ ์ง€ (๊ธฐ๋ณธ๊ฐ’)
git reset --hard HEAD~1   # ์ปค๋ฐ‹ + ๋ณ€๊ฒฝ์‚ฌํ•ญ ๋ชจ๋‘ ์‚ญ์ œ (์œ„ํ—˜!)

# โš ๏ธ pushํ•œ ์ปค๋ฐ‹์€ reset ๊ธˆ์ง€ โ†’ revert ์‚ฌ์šฉ

# Revert - ์ปค๋ฐ‹์„ ๋˜๋Œ๋ฆฌ๋Š” ์ƒˆ ์ปค๋ฐ‹ ์ƒ์„ฑ (ํžˆ์Šคํ† ๋ฆฌ ๋ณด์กด)
git revert <commit-hash>
git revert HEAD  # ๋งˆ์ง€๋ง‰ ์ปค๋ฐ‹ ๋˜๋Œ๋ฆฌ๊ธฐ

Merge Conflict ํ•ด๊ฒฐ

Conflict ๋ฐœ์ƒ ์‹œ๋‚˜๋ฆฌ์˜ค

# main์„ mergeํ•˜๊ฑฐ๋‚˜ rebaseํ•  ๋•Œ ์ถฉ๋Œ ๋ฐœ์ƒ
git merge main
# ๋˜๋Š”
git rebase main

# Auto-merging src/index.ts
# CONFLICT (content): Merge conflict in src/index.ts

Conflict ํ•ด๊ฒฐ ๊ณผ์ •

# 1. ์ถฉ๋Œ ํŒŒ์ผ ํ™•์ธ
git status

# 2. ํŒŒ์ผ ์—ด์–ด์„œ ์ˆ˜๋™ ์ˆ˜์ •
# <<<<<<< HEAD (ํ˜„์žฌ ๋ธŒ๋žœ์น˜)
# ๋‚ด ๋ณ€๊ฒฝ์‚ฌํ•ญ
# =======
# ์ƒ๋Œ€ ๋ธŒ๋žœ์น˜์˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ
# >>>>>>> main

# 3. ๋งˆ์ปค ์ œ๊ฑฐํ•˜๊ณ  ์ฝ”๋“œ ์ˆ˜์ •
# 4. ํ•ด๊ฒฐ๋œ ํŒŒ์ผ staging
git add src/index.ts

# 5. Merge ์™„๋ฃŒ
git merge --continue
# ๋˜๋Š” Rebase ๊ณ„์†
git rebase --continue

Conflict ํ•ด๊ฒฐ ์ „๋žต

# ํ˜„์žฌ ๋ธŒ๋žœ์น˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ ์šฐ์„ 
git restore --ours <file>

# ์ƒ๋Œ€ ๋ธŒ๋žœ์น˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ ์šฐ์„ 
git restore --theirs <file>

# merge ์ทจ์†Œ
git merge --abort

# rebase ์ทจ์†Œ
git rebase --abort

์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” ๋ช…๋ น์–ด

๋ธŒ๋žœ์น˜ ์ž‘์—… (git switch)

# ๊ธฐ์กด ๋ธŒ๋žœ์น˜๋กœ ์ „ํ™˜
git switch main
git switch feature/my-feature

# ์ƒˆ ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ + ์ „ํ™˜
git switch -c feature/new-feature

# ์ด์ „ ๋ธŒ๋žœ์น˜๋กœ ๋Œ์•„๊ฐ€๊ธฐ
git switch -

# ์›๊ฒฉ ๋ธŒ๋žœ์น˜ ์ถ”์ ํ•˜๋ฉฐ ์ „ํ™˜
git switch -c local-branch origin/remote-branch

์ฐธ๊ณ : Git 2.23+ (2019๋…„ 8์›”)๋ถ€ํ„ฐ git switch๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. ๊ธฐ์กด git checkout์€ ๋ธŒ๋žœ์น˜ ์ „ํ™˜, ํŒŒ์ผ ๋ณต์› ๋“ฑ ์—ฌ๋Ÿฌ ์—ญํ• ์„ ๋‹ด๋‹นํ•ด ํ˜ผ๋ž€์„ ์•ผ๊ธฐํ–ˆ๋‹ค. git switch๋Š” ๋ธŒ๋žœ์น˜ ์ „ํ™˜๋งŒ ๋‹ด๋‹นํ•œ๋‹ค.

ํŒŒ์ผ ๋ณต์› (git restore)

# ์ž‘์—… ๋””๋ ‰ํ† ๋ฆฌ ํŒŒ์ผ ๋ณต์› (unstaged ๋ณ€๊ฒฝ์‚ฌํ•ญ ์ทจ์†Œ)
git restore <file>

# Staging ์ทจ์†Œ (unstaged๋กœ ๋˜๋Œ๋ฆผ)
git restore --staged <file>

# ์ž‘์—… ๋””๋ ‰ํ† ๋ฆฌ + Staging ๋ชจ๋‘ ๋ณต์›
git restore --staged --worktree <file>

# ํŠน์ • ์ปค๋ฐ‹์˜ ํŒŒ์ผ๋กœ ๋ณต์›
git restore --source=<commit-hash> <file>

์ฐธ๊ณ : git restore๋Š” ํŒŒ์ผ ๋ณต์› ์ „์šฉ ๋ช…๋ น์–ด๋‹ค. ๊ธฐ์กด git checkout -- <file>์„ ๋Œ€์ฒดํ•œ๋‹ค.

์ƒํƒœ ํ™•์ธ

git status              # ๋ณ€๊ฒฝ์‚ฌํ•ญ ํ™•์ธ
git log --oneline       # ์ปค๋ฐ‹ ํžˆ์Šคํ† ๋ฆฌ (ํ•œ ์ค„)
git log --graph         # ๋ธŒ๋žœ์น˜ ๊ทธ๋ž˜ํ”„
git diff                # ๋ณ€๊ฒฝ ๋‚ด์šฉ ํ™•์ธ
git diff --staged       # staging๋œ ๋ณ€๊ฒฝ ๋‚ด์šฉ
git show <commit-hash>  # ํŠน์ • ์ปค๋ฐ‹ ์ƒ์„ธ๋ณด๊ธฐ

Stash (์ž„์‹œ ์ €์žฅ)

git stash               # ํ˜„์žฌ ์ž‘์—… ์ž„์‹œ ์ €์žฅ
git stash list          # ์ €์žฅ๋œ stash ๋ชฉ๋ก
git stash pop           # ๋งˆ์ง€๋ง‰ stash ์ ์šฉ + ์‚ญ์ œ
git stash apply         # ๋งˆ์ง€๋ง‰ stash ์ ์šฉ (์œ ์ง€)
git stash drop          # ๋งˆ์ง€๋ง‰ stash ์‚ญ์ œ
git stash clear         # ๋ชจ๋“  stash ์‚ญ์ œ

์›๊ฒฉ ์ €์žฅ์†Œ

git remote -v           # ์›๊ฒฉ ์ €์žฅ์†Œ ํ™•์ธ
git fetch origin        # ์›๊ฒฉ ๋ณ€๊ฒฝ์‚ฌํ•ญ ๊ฐ€์ ธ์˜ค๊ธฐ (๋ณ‘ํ•ฉ X)
git pull origin main    # ์›๊ฒฉ ๋ณ€๊ฒฝ์‚ฌํ•ญ ๊ฐ€์ ธ์˜ค๊ธฐ + ๋ณ‘ํ•ฉ
git push origin main    # ๋กœ์ปฌ ๋ณ€๊ฒฝ์‚ฌํ•ญ ํ‘ธ์‹œ
git push -f origin main # ๊ฐ•์ œ ํ‘ธ์‹œ (โš ๏ธ ์œ„ํ—˜ - ํŒ€ ์ž‘์—… ์‹œ ๊ธˆ์ง€)

์ฃผ์˜ ์‚ฌํ•ญ (Anti-patterns)

ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ์—์„œ ๋ถˆํ•„์š”ํ•œ git -C ์‚ฌ์šฉ

# โŒ ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ๋Œ€์ƒ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์ธ๋ฐ -C ์˜ต์…˜ ์‚ฌ์šฉ
git -C /path/to/current/repo log --oneline

# โœ… ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ์—์„œ ๋ฐ”๋กœ ์‹คํ–‰
git log --oneline

ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ์ž‘์—… ๋Œ€์ƒ ๋ ˆํฌ์ง€ํ† ๋ฆฌ์™€ ๋™์ผํ•˜๋ฉด git -C ์˜ต์…˜์€ ๋ถˆํ•„์š”ํ•œ ์ค‘๋ณต์ด๋‹ค. ๋‹ค๋ฅธ ๊ฒฝ๋กœ์˜ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ฅผ ๋Œ€์ƒ์œผ๋กœ ํ•  ๋•Œ๋งŒ ์‚ฌ์šฉํ•œ๋‹ค.

๋ณด์•ˆ ๋ฐ ์ฃผ์˜์‚ฌํ•ญ

์ ˆ๋Œ€ ์ปค๋ฐ‹ํ•˜๋ฉด ์•ˆ ๋˜๋Š” ํŒŒ์ผ

# .gitignore์— ์ถ”๊ฐ€
.env                    # ํ™˜๊ฒฝ ๋ณ€์ˆ˜ (API ํ‚ค, ๋น„๋ฐ€๋ฒˆํ˜ธ)
.env.local
*.key                   # ์ธ์ฆ์„œ ํ‚ค
*.pem
secrets/                # ์‹œํฌ๋ฆฟ ๋””๋ ‰ํ† ๋ฆฌ
node_modules/           # ์˜์กด์„ฑ (package.json์œผ๋กœ ๊ด€๋ฆฌ)
dist/                   # ๋นŒ๋“œ ๊ฒฐ๊ณผ๋ฌผ
.DS_Store               # macOS ์‹œ์Šคํ…œ ํŒŒ์ผ

์‹ค์ˆ˜๋กœ ์ปค๋ฐ‹ํ•œ ์‹œํฌ๋ฆฟ ์ œ๊ฑฐ

# โš ๏ธ ํžˆ์Šคํ† ๋ฆฌ์—์„œ ์™„์ „ ์‚ญ์ œ (git filter-branch ๋Œ€์‹  BFG ์‚ฌ์šฉ)
brew install bfg
bfg --delete-files .env
git reflog expire --expire=now --all && git gc --prune=now --aggressive

# โš ๏ธ ์ฃผ์˜: ์ด๋ฏธ ํ‘ธ์‹œํ–ˆ๋‹ค๋ฉด ์‹œํฌ๋ฆฟ ์ฆ‰์‹œ ํ๊ธฐ ํ›„ ์žฌ๋ฐœ๊ธ‰ ํ•„์ˆ˜

Force Push ๊ธˆ์ง€ (๊ณต์œ  ๋ธŒ๋žœ์น˜)

# โŒ main/develop์— force push ์ ˆ๋Œ€ ๊ธˆ์ง€
git push -f origin main

# โœ… ๊ฐœ์ธ feature ๋ธŒ๋žœ์น˜์—์„œ๋งŒ ํ—ˆ์šฉ
git push -f origin feature/my-branch

GitHub CLI ํ™œ์šฉ

# PR ์ƒ์„ฑ
gh pr create --title "feat: add new feature" --body "Description..."

# PR ๋ชฉ๋ก ํ™•์ธ
gh pr list

# PR ์ƒ์„ธ๋ณด๊ธฐ
gh pr view 123

# PR ์ฒดํฌ์•„์›ƒ (๋กœ์ปฌ์—์„œ ํ…Œ์ŠคํŠธ)
gh pr checkout 123

# PR ๋ณ‘ํ•ฉ
gh pr merge 123 --squash

# Issue ์ƒ์„ฑ
gh issue create --title "Bug found" --body "Description..."

์ถ”๊ฐ€ ํ•™์Šต ์ž๋ฃŒ

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.