Thuta Learning
Git & GitHub: Collaboration and Professional Workflows
BasicDevOps & Toolsintermediate

GitHub Repository တစ်ခုကို လမ်းညွှန်ခြင်း

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • GitHub Repository တစ်ခုကို လမ်းညွှန်ခြင်း concept ကို နားလည်ရှင်းပြနိုင်ရန်
  • Diagram ကို ဖတ်ပြီး Git/GitHub workflow ထဲမှာ state (သို့) data ဘယ်လိုစီးဆင်းသလဲ ခြေရာခံနိုင်ရန်
  • ကိုယ့် project/team အတွက် ဘယ်လို အသုံးချသင့်သလဲ ဆုံးဖြတ်နိုင်ရန်

နားလည်ထားရမယ့် အချက်

GitHub ပေါ်က repository တစ်ခုကို ဖွင့်လိုက်ရင် Code tab ပေါ်ကို ရောက်သွားပါတယ်၊ default branch ပေါ်က လက်ရှိဖိုင်တွေနှင့် README ကို တွေ့ရမှာပါ — သင့်ကွန်ပျူတာပေါ်က folder ကိုဖွင့်တာနှင့် အနီးစပ်ဆုံးပါပဲ၊ ကွာတာက အမြဲတမ်း push လုပ်ထားတဲ့ နောက်ဆုံး version ဖြစ်နေတာပါ။

ထိပ်ဆုံးမှာ tab တွေအတန်းလိုက် ရှိနေပြီး၊ ဘယ် tab က ဘာအတွက်လဲဆိုတာ သိထားရင် နောက်ပိုင်း ရှာမနေရတော့ပါဘူး။

  • Issues — bug report၊ feature request၊ မေးခွန်းများကို thread သီးသန့်များအနေနှင့် ဆွေးနွေးသည်
  • Pull requests — Code tab ထဲ မဝင်ခင် review, merge စောင့်နေသော branch များ
  • Actions — push သို့မဟုတ် pull request အသစ်ကဲ့သို့ event တစ်ခုတွင် automated workflow (test, deploy) run ပေးသည်
  • Releases — commit အချို့ကို version တင်ထားသော download လုပ်နိုင်သည့် snapshot အဖြစ် ထုတ်သည်
  • Settings — access, branch protection, ခွင့်ပြုထားသော merge စသည့် repository-level configuration

ထပ်ပြီး Code tab ထဲမှာပဲ ပါဝင်နေတဲ့ tab အဆင့်မဟုတ်တဲ့ အစိတ်အပိုင်းနှစ်ခု ရှိပါသေးတယ် — remote မှာ ရှိသမျှ branch တွေကို ပြသတဲ့ branch switcher တစ်ခုနှင့်၊ push လုပ်ခဲ့ဖူးသမျှ commit တိုင်းကို အစဉ်လိုက် ကြည့်နိုင်ပြီး ဘာပြောင်းလဲသွားလဲဆိုတာ click နှိပ်ကြည့်လို့ရတဲ့ commit history view တစ်ခုပါ။

ဒါတွေအတွက် ခလုတ်တွေရဲ့ တည်နေရာအတိအကျကို အလွတ်ကျက်စရာ မလိုပါဘူး — GitHub က interface ကို အခါအားလျော်စွာ ပြန်ပြင်လေ့ ရှိပါတယ်။ အရေးကြီးတာက mental map ပါ — history၊ proposed change၊ ဆွေးနွေးမှု၊ automation တွေ ဘယ်နေရာမှာနေလဲဆိုတာမျိုးပါ။

text
REPOSITORY MAP
--------------
                REPOSITORY MAP (github.com/you/project)
------------------------------------------------------------
Code          current files + README ("folder" view, latest)
Issues        bug reports, feature requests, discussions
Pull requests branches proposed for review and merge
Actions       automated workflows: tests, deploys, CI/CD
Releases      versioned, downloadable snapshots
Settings      access control, branch protection, config

Inside Code tab:  [ branch switcher ]   [ commit history ]

လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်

Terminal နှင့် web UI ကြားက တံတားက remote URL ပါပဲ။ clone လုပ်ထားတဲ့ repository ထဲမှာ git remote -v ကို run လိုက်ရင် GitHub က ဒီ repository ကို ခွဲခြားသတ်မှတ်ဖို့ သုံးတဲ့ address အတိအကျကို ပြန်ရမှာပါ — https:// version ကို browser ထဲ paste လုပ်လိုက်ရင် Code tab ပေါ်ကို တိုက်ရိုက် ရောက်သွားပါလိမ့်မယ်။

Branch စစ်ပါ

ဘယ် branch ကို ပြသနေလဲ စစ်ဆေးပါ — switch မလုပ်ရင် default branch ဖြစ်တဲ့ main အများဆုံးပါပဲ။

ဖိုင်များ ကြည့်ပါ

local မှာ မျှော်လင့်ထားတဲ့ ဖိုင်များနှင့် ကိုက်ညီမလားဆိုတာ file list ကို ကြည့်ပါ။

Commit history ကြည့်ပါ

နောက်ဆုံး pull လုပ်ချိန်ကတည်းက ဘယ်သူများ push လုပ်ခဲ့လဲဆိုတာ ကြည့်ပါ။

အခြားသူ project တစ်ခုကို contribute မလုပ်ခင်

Repository က မရင်းနှီးသေးဆိုရင် code မရေးခင် Issues နှင့် Pull requests tab တွေကို မိနစ်နှစ်မိနစ်လောက် ဖတ်ကြည့်ပါ — ဘာတွေ လုပ်ဆောင်နေပြီးသားလဲ၊ ဘယ် convention မျှော်လင့်ထားလဲ ပေါ်လွင်တတ်ပါတယ်။

Repository page ကို ဖိုင် browser တစ်ခုအနေနှင့် မသတ်မှတ်ဘဲ dashboard တစ်ခုအနေနှင့် သဘောထားခြင်းက ဒီ chapter နောက်ပိုင်းမှာ ရှက်စရာကောင်းတဲ့ pull request တွေကနေ ကယ်တင်ပေးပါလိမ့်မယ်။

အတူတူ စမ်းရေးကြည့်မယ်

bash
git init -q -b main
git remote add origin https://github.com/octocat/Hello-World.git
git remote -v
You should see
git remote -v က URL တစ်ခုတည်းကို နှစ်ခါပြပါတယ် — fetch အတွက် တစ်ခါ၊ push အတွက် တစ်ခါ:
origin  https://github.com/octocat/Hello-World.git (fetch)
origin  https://github.com/octocat/Hello-World.git (push)
https:// URL ကို browser ထဲ paste လုပ်ရင် အဲဒီ repository ရဲ့ Code tab ပေါ်ကို တိုက်ရိုက် ရောက်သွားပါလိမ့်မယ်။

၅ မိနစ် စမ်းကြည့်

သင် clone လုပ်ထားတဲ့ repository တစ်ခုအတွက် git remote -v ကို run ပါ။ ပြီးရင် browser ထဲမှာ အဲဒီ URL ကို ဖွင့်ပြီး Code, Issues, Pull Requests, Actions tab လေးခုကို တစ်ခုချင်းစီ ကြည့်ပြီး ဘာတွေ ပါဝင်နေလဲ မှတ်ချက်ချကြည့်ပါ။

သတိလေးတစ်ချက်

Issue နှင့် Pull request ကို ရောနှောထင်မှတ်ခြင်း — Issue က discussion thread တစ်ခုသာဖြစ်ပြီး code ပြောင်းလဲမှု မပါ၊ Pull request သာ branch တစ်ခုကို ကိုယ်စားပြုသည်

Settings tab ကို လျစ်လျူရှုထားခြင်း — branch protection rule များ ဒီနေရာမှာသာ configure လုပ်ရပြီး၊ ၎င်းက မှားယွင်းသော push များကို ကာကွယ်ပေးသည်

GitHub Docs: Navigating code on GitHubGit & GitHub

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Issue နှင့် Pull request ကို ရောနှောထင်မှတ်ခြင်း — Issue က discussion thread တစ်ခုသာဖြစ်ပြီး code ပြောင်းလဲမှု မပါ၊ Pull request သာ branch တစ်ခုကို ကိုယ်စားပြုသည်
  • Settings tab ကို လျစ်လျူရှုထားခြင်း — branch protection rule များ ဒီနေရာမှာသာ configure လုပ်ရပြီး၊ ၎င်းက မှားယွင်းသော push များကို ကာကွယ်ပေးသည်
  • Destructive (သို့) history ပြောင်းလဲနိုင်တဲ့ command တိုင်းကို run မခင် git status နဲ့ လက်ရှိအခြေအနေကို အမြဲစစ်ပါ။

လေ့ကျင့်ခန်း

သင် clone လုပ်ထားတဲ့ repository တစ်ခုအတွက် git remote -v ကို run ပါ။ ပြီးရင် browser ထဲမှာ အဲဒီ URL ကို ဖွင့်ပြီး Code, Issues, Pull Requests, Actions tab လေးခုကို တစ်ခုချင်းစီ ကြည့်ပြီး ဘာတွေ ပါဝင်နေလဲ မှတ်ချက်ချကြည့်ပါ။

You'll know it worked when: git remote -v က URL တစ်ခုတည်းကို နှစ်ခါပြပါတယ် — fetch အတွက် တစ်ခါ၊ push အတွက် တစ်ခါ: origin https://github.com/octocat/Hello-World.git (fetch) origin https://github.com/octocat/Hello-World.git (push) https:// URL ကို browser ထဲ paste လုပ်ရင် အဲဒီ repository ရဲ့ Code tab ပေါ်ကို တိုက်ရိုက် ရောက်သွားပါလိမ့်မယ်။

GitHub Repository တစ်ခုကို လမ်းညွှန်ခြင်း | Thuta Learning