Working Directory
你正在編輯的實際檔案。The real files you are editing.
app.jsGIT & GITHUB從零開始的 11 單元11 units from the ground up
每輸入一條 Git 指令,檔案、branch 與 commit 都會跟著變化。這裡把看不見的狀態畫出來,陪你從第一次 commit 一路走到 GitHub 協作。Every Git command changes files, branches, or commits. We draw those hidden states so you can move from your first commit to working with GitHub.
git log --graph --oneline狀態可視化State visualized現在發生什麼?What is happening?feature/login 從 c2 分出去,完成 c3 後再合回 main,形成 c4。feature/login branches from c2, completes c3, then merges back into main as c4.
01 / 先建立正確心智模型01 / Build the right mental model
`git add` 不是存檔,`git commit` 也不是上傳。先把四個區域分清楚,後面的 branch、merge 與 GitHub 才不會混在一起。`git add` is not Save, and `git commit` is not Upload. Separate the four areas first, and branches, merges, and GitHub will make much more sense.
你正在編輯的實際檔案。The real files you are editing.
app.jsgit add下一次 commit 準備收錄的內容。The changes selected for the next commit.
app.jsgit commit保存在你電腦裡的版本快照。Version snapshots stored on your computer.
c3 · 新增登入git pushGitHub 上與別人共享的版本。The version shared with others on GitHub.
origin/main02 / 完整學習路線02 / The complete learning path
每個單元都會先講觀念,再讓你輸入指令,最後用 Git 樹確認狀態。前一個步驟看懂了,再進下一個。Each unit starts with the idea, lets you type the command, and ends by checking the Git tree. Move on only after the current step makes sense.
先認識四個區域,理解檔案如何一步步變成版本。Meet the four areas and see how files become versions step by step.
working treestagingrepository分別完成 Windows 與 macOS 安裝,設定你的版本作者資訊。Install Git on Windows or macOS and set the author information for your versions.
configPowerShellzsh從空資料夾開始,親手走完 init、add 與 commit。Start with an empty folder and complete init, add, and commit yourself.
initaddcommit分清楚 untracked、modified、staged,學會看差異與歷史。Tell untracked, modified, and staged apart, then inspect differences and history.
statusdifflog看懂本機與遠端的關係,再練習 push、pull 與 clone。Understand local and remote repositories, then practise push, pull, and clone.
remotepushpull建立獨立支線,不影響 main 也能安全嘗試新功能。Create an isolated line of work so you can try features without changing main.
branchswitchHEAD從 Fast-forward 到分叉,逐步解開 merge conflict。Move from fast-forward merges to diverged branches and resolve a merge conflict.
mergeconflictfast-forward走完 Pull Request、code review、merge 與同步主分支。Walk through a Pull Request, code review, merge, and syncing the main branch.
pull requestreviewsync從口頭回報走到 Issue、PR review、Actions checks 與結案。Turn a verbal report into an Issue, PR review, Actions checks, and a clear close-out.
issuemaintaineractions依照是否提交、是否分享,選對 restore、revert 或 reset。Choose restore, revert, or reset based on whether the change was committed or shared.
restorerevertreset補齊 rebase、cherry-pick、tag 與 .gitignore 的使用時機。Learn when rebase, cherry-pick, tags, and .gitignore solve the right problem.
rebasecherry-picktag03 / 這套網站怎麼教03 / How this site teaches
不是把答案貼給你,而是先讓你預測下一步,再從 Git 樹和四個區域驗證自己的理解。
We do not simply paste the answer. You first predict the next step, then verify your understanding with the Git tree and four areas.
例如:把 app.js 放進 Staging Area。For example: put app.js into the Staging Area.
答錯不改動狀態,會告訴你可以觀察哪裡。A wrong answer does not change the state; it points out what to observe.
不只看到「成功」,還知道版本到底移到哪裡。You see more than success—you see exactly where the version moved.
免責聲明:本站內容為個人學習、實作與經驗分享紀錄,部分內容透過 AI 協助修正與整理。由於每位使用者的系統環境、軟體版本、權限設定與操作方式不同,實際結果可能有所差異。請在操作前自行評估風險並備份重要資料。因參考本站內容所造成之任何系統異常、資料遺失、設定錯誤、設備故障、服務中斷或其他直接、間接損失,均由使用者自行承擔,本站與作者不負任何相關責任。
Disclaimer: This site records personal learning, implementation, and experience sharing, with some content edited and organised with AI assistance. Results may differ because every user has a different system environment, software version, permission setup, and workflow. Assess risks and back up important data before trying anything. You are responsible for any system errors, data loss, configuration mistakes, equipment faults, service interruptions, or other direct or indirect losses resulting from using this content.