建立、複製、提交、上傳 — Your First Project
GitLab 不用「Repository」,改用專案(Project)與群組(Group):
| GitLab 術語 | GitHub 對應 | 說明 |
|---|---|---|
| Project(專案) | Repository | 一個專案的容器 |
| Group(群組) | Organization | 組織多個專案、管理權限 |
| Subgroup | — | 群組可巢狀 |
1. 右上角「+」→ New project / New blank project 2. 填專案名稱(如 hello-world) 3. 選 visibility(Private / Internal / Public) 4. 勾選 Initialize repository with a README 5. 按 Create project
git clone https://gitlab.com/USER/hello-world.git cd hello-world
hello-world/ ├── .git/ └── README.md
Git 的日常循環與 GitHub 完全一樣(Git 是同一套工具):
git add . git commit -m "說明" git push
git init -b main git add . git commit -m "first commit" git remote add origin https://gitlab.com/USER/hello-world.git git push -u origin main
| 層級 | 誰能看到 |
|---|---|
| Private | 只有成員 |
| Internal | 登入者可見(自架環境常見) |
| Public | 任何人(含未登入) |
自架 GitLab 時「Internal」很有用——整個公司可看,公司外看不到。
與 GitHub 站講的相同原則(README 是專案門面、.gitignore 排除敏感檔)——不再重述, 直接複習該單元。