Skip to content

00. Git Flow, Commit Convention, Directory Structure

Kim Ji-hwan edited this page Oct 2, 2022 · 1 revision

00. Git Flow, Commit Convention, Directory Structure

Git Flow


  1. νŽ˜μ΄μ§€λ³„, κΈ°λŠ₯별 new branch νŒŒμ„œ μž‘μ—….
  2. branch νŒ” λ•Œ, λ§ˆμΌμŠ€ν†€ 및 이슈 μ§€μ •ν•΄μ„œ λͺ©ν‘œ μ„Έμš΄ λ‹€μŒ μž‘μ—….
  3. νŽ˜μ΄μ§€, κΈ°λŠ₯ μž‘μ—… μ™„λ£Œ ν›„, branch merge PR 날리기.
  4. PR은 μ•„μ£Ό κΈ‰ν•œ 경우 μ•„λ‹ˆλ©΄ λ‹€λ₯Έ μ‚¬λžŒ 1인 이상이 검증 및 merge.

Directory Structure


// react

- src/
--- feature/  κΈ°λŠ₯별, νŽ˜μ΄μ§€λ³„ ꡬ뢄
----- User/
------- Profile/
------- Avatar/
----- Message/
------- MessageItem/
------- MessageList/
----- Payment/
------- PaymentForm/
------- PaymentWizard/
----- Error/
------- ErrorMessage/
------- ErrorBoundary/
--- components/  μž¬μ‚¬μš© κ°€λŠ₯ν•œ 것듀 λͺ¨μŒ. UI κ΄€λ ¨.
----- App/
----- List/
----- Input/
----- Button/
----- Checkbox/
----- Radio/
----- Dropdown/

πŸ“‚ server
    πŸ“‚ config
    β”œβ”€β”€ πŸ“„ baseResponseStatus.js
    β”œβ”€β”€ πŸ“„ database.js  
    β”œβ”€β”€ πŸ“„ express.js
    β”œβ”€β”€ πŸ“„ jwtMiddleware.js
    β”œβ”€β”€ πŸ“„ response.js
    πŸ“‚ src
    └── πŸ“‚ app           				
        β”œβ”€β”€ πŸ“‚ User          		
        |    β”œβ”€β”€ πŸ“„ userController.js          	
        |    β”œβ”€β”€ πŸ“„ userDao.js 		
        |    β”œβ”€β”€ πŸ“„ userProvider.js   		
        |    β”œβ”€β”€ πŸ“„ userRoute.js   		 
        |    └── πŸ“„ userService.js   	 
    πŸ“„ .gitignore                     		
    πŸ“„ app.js
    πŸ“„ server.js
    πŸ“„ package.json                      
    πŸ“„ README.md

[참고1(react 파일 ꡬ쑰)](https://www.robinwieruch.de/react-folder-structure/)

[react 곡식 νŽ˜μ΄μ§€ μ°Έκ³ ](https://ko.reactjs.org/docs/faq-structure.html)

[https://velog.io/@hopsprings2/κ²¬κ³ ν•œ-node.js-ν”„λ‘œμ νŠΈ-아킀텍쳐-μ„€κ³„ν•˜κΈ°](https://velog.io/@hopsprings2/%EA%B2%AC%EA%B3%A0%ED%95%9C-node.js-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-%EC%95%84%ED%82%A4%ED%85%8D%EC%B3%90-%EC%84%A4%EA%B3%84%ED%95%98%EA%B8%B0)

[[NodeJS] ν”„λ‘œμ νŠΈ 폴더 ꡬ쑰 λ§Œλ“€κΈ°](https://dev-wnstjd.tistory.com/90)

Commit Convention

1. commit message structure

[#issueNumber] type : Subject(제λͺ©)
	*ν•œ 쀄 λ„μ›Œ 뢄리*
body(μžμ„Έν•œ λ‚΄μš©)
	*ν•œ 쀄 λ„μ›Œ 뢄리*
footer(꼬리말)

#μ˜ˆμ‹œ
[#14] Feat : 둜그인 κΈ°λŠ₯ μΆ”κ°€

- νšŒμ›κ°€μž… νŽ˜μ΄μ§€ 이후에 둜그인 κΈ°λŠ₯을 μΆ”κ°€.
- 둜그인 μ‹œ μ„œλ²„ api둜 post λ³΄λ‚΄μ„œ 인증.

Related to
- 3050c3 (commit hash id)
- #5 (issueNumber)

2. commit type (첫 κΈ€μžλ§Œ λŒ€λ¬Έμž)

<κΈ°λŠ₯/μ½”λ“œ λ³€κ²½>

  • Feat : μƒˆλ‘œμš΄ κΈ°λŠ₯ / νŽ˜μ΄μ§€ μΆ”κ°€
  • Fix : 버그 μˆ˜μ • (issue νƒœκ·Έλ„ ν•¨κ»˜ κ±Έμ–΄μ£Όμ„Έμš”..)
  • Design : CSS, UI κ΄€λ ¨ 사항 λ³€κ²½

<κ°œμ„ μ‚¬ν•­>

  • Style : μ½”λ“œ ν¬λ§·νŒ…, μ½”λ“œ λͺ¨μ–‘ μˆ˜μ • (μ½”λ“œμ˜ 직접적인 μˆ˜μ •μ΄ μ—†λŠ” 경우)
  • Comment : 주석 μΆ”κ°€ 및 λ³€κ²½
  • Refactor : μ½”λ“œ λ¦¬νŒ©ν† λ§ β‡’ μƒˆλ‘œμš΄ κΈ°λŠ₯ 없이 ν˜„μž¬ κ΅¬ν˜„μ„ κ°œμ„ .

<κ·Έ μ™Έ>

  • Docs : readme, κΈ°λŠ₯ λͺ…μ„Έ μˆ˜μ •
  • Test : ν…ŒμŠ€νŠΈ κΈ°λŠ₯ μΆ”κ°€ (μ½”λ“œ, νŽ˜μ΄μ§€ λ“±)
  • Chore : λΉŒλ“œ μžλ™ν™” μ½”λ“œ 등둝, νŒ¨ν‚€μ§€ λ§€λ‹ˆμ € μˆ˜μ • λ“±.
  • Rename : 파일λͺ… μˆ˜μ •, 폴더ꡬ쑰 λ³€κ²½ λ“±
  • Remove : μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” 파일, 폴더 μ‚­μ œ μ‹œ

3. μž‘μ„± κ·œμΉ™

Subject 제λͺ© μž‘μ„±

제λͺ©μ˜ μ²˜μŒμ€ 동사 μ›ν˜•μœΌλ‘œ μ‹œμž‘.

50자 이내, κ°œμ‘°μ‹ ꡬ문으둜 μž‘μ„±.

λ§ˆμ§€λ§‰μ— 특수문자 μ‚½μž… μ•ˆν•¨(. ! ? λ“±)

<μ˜μ–΄>

Fix, Add, Change λ“±μœΌλ‘œ μ‹œμž‘

<ν•œκΈ€>

κ³ μΉ¨, μΆ”κ°€, λ³€κ²½ λ“±μœΌλ‘œ μ‹œμž‘

μ˜ˆμ‹œ)
Feat: "μΆ”κ°€ get data api ν•¨μˆ˜"

Body λ³Έλ¬Έ μž‘μ„±

ν•œ 쀄 λ‹Ή 72자 이내.

양에 μ œν•œλ°›μ§€ μ•Šκ³  μ΅œλŒ€ν•œ μƒμ„Ένžˆ μž‘μ„±.

μ–΄λ–»κ²Œ λ³€κ²½ν–ˆλŠ”μ§€λ³΄λ‹€ 무엇을 λ³€κ²½ν–ˆλŠ”μ§€, μ™œ λ³€κ²½ν–ˆλŠ”μ§€λ₯Ό μœ„μ£Όλ‘œ μž‘μ„±

Footer 꼬리말 μž‘μ„±

꼬리말은 κΌ­ 적어야 ν•˜λŠ” 건 μ•„λ‹ˆλ‹€.

<이슈 트래컀 μœ ν˜•>

Fixes : 아직 μˆ˜μ •μ€‘μΈ 이슈

Resolves : ν•΄κ²°ν•œ 이슈

Ref : μ°Έκ³ ν•  이슈/컀밋

Related to : ν•΄λ‹Ή 컀밋에 κ΄€λ ¨λœ 이슈/컀밋 번호

[#숫자] ν˜•μ‹μœΌλ‘œ μ“°λ©΄ githubμ—μ„œ μžλ™μœΌλ‘œ ν•΄λ‹Ή 이슈 링크 κ±Έμ–΄μ€€λ‹€.

[000000] ν˜•μ‹μœΌλ‘œ μ“°λ©΄ githubμ—μ„œ μžλ™μœΌλ‘œ ν•΄λ‹Ή 컀밋 링크 κ±Έμ–΄μ€€λ‹€.


[ν˜‘μ—…μ„ μœ„ν•œ 컀밋 μ»¨λ²€μ…˜](https://overcome-the-limits.tistory.com/entry/%ED%98%91%EC%97%85-%ED%98%91%EC%97%85%EC%9D%84-%EC%9C%84%ED%95%9C-%EA%B8%B0%EB%B3%B8%EC%A0%81%EC%9D%B8-git-%EC%BB%A4%EB%B0%8B%EC%BB%A8%EB%B2%A4%EC%85%98-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0) πŸ‘

[컀밋 μ»¨λ²€μ…˜μ— λŒ€ν•œ μš”μ•½ 정리](https://doublesprogramming.tistory.com/256)

Issue Convention(tag, template)

μ΄μŠˆλŠ” tagλ₯Ό λΆ™μ—¬μ„œ κΈ°λŠ₯/μ—­ν•  λ³„λ‘œ ꡬ뢄이 κ°€λŠ₯.

λŒ€λΆ€λΆ„ Commit Type λŒ€λ‘œ λ§Œλ“€μ–΄ λ†“μœΌλ©΄ νŽΈν•˜λ‹€.

To Do : ν•΄μ•Ό ν•  일(milestone에 ν¬ν•¨μ‹œν‚€λŠ” issue μš©λ„) Bug : 개발된 μ½”λ“œμ—μ„œ μ°Ύμ•„λ‚Έ 버그

Question (질문/κ±΄μ˜μ‚¬ν•­) : νŠΉμ • κΈ°λŠ₯ / μ½”λ“œμ— λŒ€ν•œ 질문

githubμ—μ„œ issue template을 λ§Œλ“€μ–΄μ„œ λΉ λ₯Έ 생성 κ°€λŠ₯

++

front κ΄€λ ¨λœ 것은 frontend / back κ΄€λ ¨λœ 것은 backend 라벨 맨 μ•žμ— μΆ”κ°€, 곡톡 사항이면 λ‘˜λ‹€ 뢙이지 μ•ŠκΈ°.


https://taekki-dev.tistory.com/40

https://hyeonic.tistory.com/181

브랜치 μ „λž΅ / git flow

main : 우리의 주된 μ½”λ“œλ“€ / 잘 μž‘λ™λ˜λŠ”, 배포가λŠ₯ν•œ μ½”λ“œλ“€

frontend : ν”„λ‘ νŠΈ μ½”λ“œλ“€

backend : λ°± μ½”λ“œλ“€

gh-pages : μΆ”ν›„ github page둜 배포할 λ•Œ??

frontend/feature

frontend/feature/login

ν˜•νƒœμ˜ 브랜치 생성?

β‡’ gitμ—μ„œ ν•˜μœ„ 브랜치둜 / (μŠ¬λž˜μ‹œ)λ₯Ό μ“°λŠ” 것은 였λ₯˜λ₯Ό λΏœλŠ”λ‹€.

β‡’ frontend-feature , frontend-feature-loginκ³Ό 같은 ν˜•νƒœ