21CT logo

Git ဆိုတာဘာလဲ — ကိုယ့် project အပြောင်းအလဲတွေကို စနစ်တကျ သိမ်းဆည်းခြင်း

final-v2-new ဆိုတဲ့ ဖိုင်တွေ မရှုပ်တော့အောင် Git ရဲ့ repository၊ commit နဲ့ branch အယူအဆတွေကို လက်တွေ့ command တွေနဲ့ စလေ့လာပါ။

21CT Admin7 min read10/19/2026
Git ဆိုတာဘာလဲ — ကိုယ့် project အပြောင်းအလဲတွေကို စနစ်တကျ သိမ်းဆည်းခြင်း
#Git#GitHub#Beginner
Project တစ်ခုကို ပြင်ရင်း project-final၊ project-final-new ဆိုပြီး folder တွေ ပွားဖူးပါသလား။ Git လို version control စနစ်က ဖိုင်အပြောင်းအလဲ မှတ်တမ်းကို သိမ်းထားပြီး ဘယ်အချိန်မှာ ဘာပြင်ခဲ့သလဲဆိုတာ ပြန်ကြည့်နိုင်အောင် ကူညီပါတယ်။ အဓိက စကားလုံး သုံးလုံး Repository ဆိုတာ project နဲ့ သူ့အပြောင်းအလဲ မှတ်တမ်းကို ထိန်းထားတဲ့ နေရာပါ။ Commit က ရွေးချယ်ထားတဲ့ အပြောင်းအလဲတွေကို ရှင်းလင်းတဲ့ မှတ်ချက်တစ်ခုနဲ့ သိမ်းထားတဲ့ မှတ်တိုင်လို ဖြစ်ပါတယ်။ Branch က လုပ်ဆောင်ချက်အသစ် စမ်းသပ်ဖို့ သီးခြားအလုပ်လုပ်နိုင်တဲ့ လမ်းကြောင်းပါ။ အလွတ်လေ့ကျင့်ခန်း folder တစ်ခုမှာ စတင်ပါ အောက်က command တွေကို ကိုယ့်လေ့ကျင့်ခန်း folder ထဲမှာသာ သုံးပါ။ အဲဒီထဲမှာ notes.txt ဖိုင်တစ်ခုကို စာအနည်းငယ်ရေးပြီး သိမ်းထားပါ။ git init git status git add notes.txt git commit -m "Add learning notes" git log --oneline ပထမဆုံး commit လုပ်တဲ့အခါ Git က author name နဲ့ email သတ်မှတ်ဖို့ တောင်းနိုင်ပါတယ်။ Public repository မှာ commit author အချက်အလက် မြင်နိုင်တာကို နားလည်ပြီးမှ သုံးပါ။ notes.txt ကို ပြန်ပြင်ပြီး git diff နဲ့ မသိမ်းရသေးတဲ့ အပြောင်းအလဲကို ကြည့်နိုင်ပါတယ်။ Git နဲ့ GitHub က မတူပါဘူး Git က သင့်စက်မှာ အလုပ်လုပ်နိုင်တဲ့ version control ကိရိယာပါ။ GitHub ကတော့ repository တွေကို အွန်လိုင်းမှာ သိမ်းပြီး ပူးပေါင်းလုပ်နိုင်တဲ့ ဝန်ဆောင်မှုတစ်ခုပါ။ Local commit လုပ်ထားရုံနဲ့ GitHub ကို ရောက်သွားတာ မဟုတ်ပါဘူး။ Remote ချိတ်ပြီး push လုပ်ဖို့ သီးခြားအဆင့် လိုပါတယ်။ ကောင်းတဲ့ အလေ့အကျင့် အလုပ်တစ်မျိုး ပြီးတိုင်း သေးငယ်ရှင်းလင်းတဲ့ commit လုပ်ပါ။ Password၊ database URL၊ API key နဲ့ ကျောင်းသားတွေရဲ့ ကိုယ်ရေးအချက်အလက်ကို repository ထဲ မထည့်ပါနဲ့။ .gitignore က မထည့်ရသေးတဲ့ ဖိုင်တွေကို လျစ်လျူရှုစေနိုင်ပေမဲ့ သိမ်းပြီးသား secret ကို history ထဲက ဖယ်ပေးတာ မဟုတ်ပါဘူး။ Git သုံးတာတစ်ခုတည်းက သင့်ဖိုင်အားလုံးရဲ့ သီးခြား backup မဖြစ်ပါဘူး။ လေ့ကျင့်ခန်း notes.txt ကို နှစ်ကြိမ်ပြင်ပြီး commit နှစ်ခုလုပ်ပါ။ Commit message ကို “update” လို့ပဲ မရေးဘဲ ဘာပြောင်းလဲခဲ့သလဲကို ရေးပါ။ git log --oneline နဲ့ မှတ်တမ်းကို ပြန်ရှင်းပြကြည့်ပါ။ ဆက်လေ့လာရန် — Pro Git: About Version Control https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control ──────────────────── English version ──────────────────── Git basics: keep a clear history of your project Folders called project-final and project-final-new quickly become confusing. Version control records changes so you can understand earlier versions and the reasons for updates. Three useful ideas A repository contains the project and its history. A commit records a selected set of changes with a message. A branch gives you a separate line of work for a feature or experiment. Start in a practice folder Create a notes.txt file with a few lines of learning notes. Run these commands inside that practice folder: git init git status git add notes.txt git commit -m "Add learning notes" git log --oneline Git may ask you to configure an author name and email before the first commit. Choose those details knowingly: commit authorship can be visible when you share a repository publicly. Edit notes.txt again and use git diff to inspect unstaged changes. Git and GitHub are different Git can work locally on your computer. GitHub is an online service for storing repositories and collaborating. A local commit does not automatically appear on GitHub. You need to configure a remote and push separately. Build good habits Make small commits that explain one useful change. Keep database connection strings, passwords, API keys and student information out of repositories. A .gitignore file can exclude untracked files, but adding a secret to it after committing does not remove that secret from history. A repository also does not replace a separate backup plan for all your files. Practice Change notes.txt twice and create two commits. Describe the actual changes instead of using only “update.” Read git log --oneline and explain the history in your own words. Source: Pro Git, About Version Control https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control

ဆွေးနွေးမှုတွင် ပါဝင်ပါ

အကောင့်မလိုပါ။ မှတ်ချက်တွင် စာသား၊ နေ့ရက်နှင့် အချိန်သာ ဖော်ပြမည်။ ကိုယ်ရေးကိုယ်တာ အချက်အလက်များ မထည့်ပါနှင့်။

မဲများမှာ အမည်မသိ အကြံပြုချက် စုစုပေါင်းဖြစ်ပြီး လူဦးရေ မဟုတ်ပါ။ ဧည့်သည် ID နှင့် မဲပေး cookie မသုံးပါ။

စာလုံးရေ ၂,၀၀၀ အထိ ရေးနိုင်ပါသည်။ မှတ်ချက်များကို အများမြင်နိုင်ပါသည်။

မှတ်ချက်များ (၀)

မှတ်ချက် မရှိသေးပါ။ ပထမဆုံး ဆွေးနွေးသူ ဖြစ်ပါစေ။

21CT မှ သင်တန်းအကြံပြုချက်

ဒီအကြောင်းအရာကို လက်တွေ့သင်တန်းအနေနဲ့ ဆက်လေ့လာချင်ပါက course catalog ကိုကြည့်ပါ။

Related articles

Python ကို စလေ့လာမယ် — variable၊ list နဲ့ loop အခြေခံ
ပရိုဂရမ်းမင်း

Python ကို စလေ့လာမယ် — variable၊ list နဲ့ loop အခြေခံ

ကုဒ်အနည်းငယ်နဲ့ စာရင်းတစ်ခုကို ဖတ်ပြခြင်း၊ အမှတ်စုစုပေါင်း တွက်ခြင်းတို့ကို စမ်းပြီး Python ရဲ့ အခြေခံအယူအဆတွေကို နားလည်ပါ။

21CT Admin 4 မိနစ် ဖတ်ရန်