Yangon , Myanmar
Sun~Sat : 9:00am~9:00pm
Image

How to level up your git commits messages

Git user developer တစ်ယောက်အနေနဲ့ Commit message စဉ်းစားရတာဟာ မခက်ခဲပေမယ့် အချိန်တစ်ခုတော့ပေးနေရတယ်မလား။ တကယ်တော့ commit တင်ရတဲ့ရည်ရွယ်ချက်က ကျွန်တော်တို့ project တစ်ခုလုံးရေးလာခဲ့သမျှ source code တွေကို record အနေနဲ့မှတ်ထားဖို့ပဲဖြစ်ပါတယ်။ ဆိုတော့ commit message တွေဟာ ဘယ်လိုပေးပေးရနေပေမယ့်လည်း ကျိုးကြောင်းဆီလျော်အောင်ပေးသင့်ပါတယ်။ ဒီနေ့ blog လေးမှာဝောာ့ developer တိုင်းရှိသင့်တဲ့ good habit တစ်ချို့ကို sharing လုပ်ပေးသွားချင်ပါတယ်။
 
ပထမတစ်ချက်ကတော့ message ဖတ်လိုက်ရုံနဲ့ code တွေက ဘယ်အချိန်ကဘာအတွက်ရေးခဲ့လဲဆိုတာတန်းသိစေနိုင်မယ့် clear and meaningful ဖြစ် တဲ့ message မျိုးကို date နဲ့တကွပေးသင့်ပါတယ်။
ဥပမာ git commit -m "Add user authentication 12_09_2024"
 
ဒုတိယအချက်အနေနဲ့ Action ကိုရှေ့မှာထည့်ရေးခြင်းပါပဲ။ Feature / module တစ်ခုမှာ အနည်းဆုံးတော့ develop နဲ့ bug fix ဆိုပြီးနှစ်မျိုးရှိနိုင်တာမလို့ action တွေထည့်ရေးထားရင် commit တွေမရောတော့သလို ပိုပြီးလည်းစနစ်ကျစေမှာ ပဲဖြစ်ပါတယ်။
ဥပမာ git commit -m "develop:auth user registration"
git commit -m "fix:auth user phone number incorrect"
 
နောက်ဆုံးတစ်ချက်အနေနဲ့ commit တစ်ခုက လုပ်ဆောင်ချင်တစ်ခုအတွက်သာဖြစ်သင့်ပါတယ်။ဒါကြောင့် message တစ်ခုဟာလည်း and တွေအထပ်ထပ်ဆက်တာလုံးဝမဖြစ်သင့်ပါဘူး။ ဥပမာ "‌add user authentication and update UI" ဆိုတာ Bad habit တစ်ခုလို့ပဲပြောရပါမယ်။
Developer တို့အနေနဲ့ ဒီ post လေးဖတ်ပြီးတဲ့အခါ commit တွေကို first commit , second commit
ဆိုပြီး ပေါက်ကရတွေပေးနေတဲ့အကျင့်ရှိ‌ခဲ့ရင် ပြင်ကြမယ်လို့ကျွန်တော်ယုံကြည်ပါတယ်ဗျ။
 
 commit တွေကို module တစ်ခုပြီးတိုင်းတင်ပါ။ အဓိပ္ပာယ်ရှိတဲ့ message တွေရေးပါ။ commit ကို main branch မှာတန်းတင်တာမျိုးမလုပ်ပဲ branch တွေခွဲပြီးတင်ပါ။ commit မတင်ခင်တိုင်းမှာ code တွေကိုသေချာ refactor လုပ်ဖို့ testing လုပ်ဖို့လည်းမမေ့ပါနဲ့။
ဒီအချက်တွေကတော့ commit အတွက် good habit တွေပဲဖြစ်ပါတယ်။ ကျေးဇူးတင်ပါတယ်ဗျ။

Categories: Tips And Tricks

Login with your account to share your thoughts...

Comments

No comment yet.

Related Posts

Tips For Testing A W...
Developer တစ်ယောက်တွက် development ပြီးသွားတာနဲ့  testi...
Read Now
thumb-image
GitHub 1s
အားလုံးပဲမင်္ဂလာပါခင်ဗျ။ ဒီနေ့အတွက် blog ကတော့ developer...
Read Now
thumb-image