Skip to main content

Git Fork and Pull Request

μ›ν•˜λŠ” μ €μž₯μ†Œ fork​

  • μ›ν•˜λŠ” μ €μž₯μ†Œμ—κ°€μ„œ fork<owner>/<repository>
  • fork된 μ €μž₯μ†Œ<contributor>/<repository>

fork된 μ €μž₯μ†Œ clone​

git clone<contributor>/<repository>

branch 관리​

branch 확인​

git branch -a
* master
remotes/origin/HEAD -> origin/master

branch 생성​

git checkout -b <new_branch> [<branch_to_copy>]

branch 변경​

git checkout <branch>

code μˆ˜μ •β€‹

git add <file>
git commit -m "<message>"
git push origin <branch>

원 μ €μž₯μ†Œμ— μ—…λ°μ΄νŠΈλœ λ‚΄μš© local에 병합​

git remote add upstream<owner>/<repository>
git pull upstream <branch>

conflict 파일이 μžˆλŠ” κ²½μš°β€‹

vim <conflict_file>
git add <conflict_file>
git commit
git push origin <new_branch>

Pull Request​

After PR complete​

fork된 μ €μž₯μ†Œλ₯Ό μœ μ§€ν•  μ˜ˆμ •μ΄λΌλ©΄ μž‘μ—… 쀑인 브랜치λ₯Ό μ—…λ°μ΄νŠΈ ν•©λ‹ˆλ‹€.

git checkout <branch>
git pull upstream <branch>