[Git]Good Commits

Donghun Seol·2022년 12월 19일
1

1.

개발은 복잡한 워크플로에서 발생하는 복잡성을 단순화 하면서 예외상황들을 효과적으로 통제하며 수행되어야 한다. 복잡성을 정제하지 않고 무분별하게 신규 기능만 추가한 프로젝트는 결국 기도메타로 해결해야 한다..

2.

최근 간단한 프로젝트를 만들어 보면서 개발, 협업, 배포, 피드백까지 소프트웨어 프로젝트의 사이클을 경험한 것은 매우 의미있는 작업이었다. 개발과정의 복잡성을 통제하고 프로젝트를 성공적으로 발전시켜나가기 위해서 단위테스트, 통합테스트, Linting, Git 브랜칭 전략, CI/CD등의 중요함을 다시 한번 깨달았다. 개발은 코드만 작성하는 작업이 아니라, 코드를 중심으로 돌아가는 개발과 배포, 피드백의 생명주기가 효과적으로 돌아가게 하는 작업의 총체와 해당 작업을 효과적으로 수행하기 위한 환경 전체를 의미하는 것이다. 소프트웨어 프로젝트는 절대 특정 시점에서 끝나는 작업이 아니다. 끊임없이 내/외부 환경과 상호작용하면서 유기적으로 진화하는 생명체와 같다.

3.

협업하는 동료와 미래의 나에게 친절한 커밋을 만들고, 생산성을 향상시키기 위한 첫 번째로 가져야 할 능력은 좋은 커밋을 만드는 능력이다. 좋은 커밋에 대해 고민해보다 이곳을 학습하면서 배운 간단하게 정리해 보았다.

1. don't cram all changes into single commit

commits should only contain changes from relevant topic.
you can choose what to commit within single file by using git staging concepts
instead of git add . use git add -P index.js (-P means Patch) to choose commitable content.
by doing so you can get meaningful and valuable commit logs

2. Good commit message

commit message consists of subject and body

  • subject : concise summary of what happend
  • body : what changed? why changed? any important remarks?

3. branching strategy

there are two well-known strategies git flow, github flow. for small projects github flow is recommended. strategies basically divde branches into two groups.

  1. Long-Running
    persisting branch throughout project lifecylce
    should not commit directly to Long-Running branches. use merge or pull request instead.
  • main : working product, deploy
  • dev : intergrate feature, integration test before merging main branch
  1. Short-Lived
    will be deleted after successful merge.
  • feature : unit test
  • experiment
profile
I'm going from failure to failure without losing enthusiasm

0개의 댓글