Files
DailyChallenge_ProgrammingD…/Day_0/README.md
T

52 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Day_0 · Git 入门与 Hello World(第零节)
> 预计耗时:20~30 分钟
> 这一节不写任何难代码,只做三件事:**会用 Git、会克隆仓库、会把文件传上来**。
## 今日知识点
Git 是一个**代码版本管理工具**。今天只需要掌握三个动作:
- `git clone`:把远程仓库复制到你的电脑
- `git add` + `git commit`:把改动"登记"成本地记录
- `git push`:把本地记录**上传**到远程仓库
## 先学(教程)
- 菜鸟教程 Git:https://www.runoob.com/git/git-tutorial.html
- B站(零基础保姆级,看 1~6 讲即可:核心概念 / 区域 / 远程仓库):https://www.bilibili.com/video/BV1wJ4m1u7te/
- 备选(含 GitLab 上手,和我们用的平台很像):https://www.bilibili.com/video/BV1Bcm4BWE2c/
## 任务(后做)
1. 安装 Git:https://git-scm.com/download/win ,一路默认下一步
2. 打开命令行(Windows 按 Win+R 输入 `cmd`),运行 `git --version`,看到版本号即成功
3. 注册/登录 https://git.itouc.cn (用你的真实姓名,学长要认人)
4. 克隆本仓库到本地(命令见仓库页面 Code → Clone 的 HTTPS 地址):
```
git clone https://git.itouc.cn/ITStudio_OUC/DailyChallenge_ProgrammingDepartment.git
```
5. 进入仓库文件夹,新建一个**以你自己昵称命名的文件夹**(例如 `zhang_san/`),
在里面新建 `hello.py`,文件内容**直接写**(一个字符都不要错):
```python
print("Hello World")
```
6. 在命令行依次执行(把昵称换成你的):
```
git add .
git commit -m "add hello world"
git push
```
命令行提示要输入用户名密码时,用户名填你的昵称,密码填你的访问令牌(不会用令牌就找学长)。
7. 刷新仓库网页,确认 `你的昵称/hello.py` 出现了
> 为什么建自己的文件夹而不是直接放 hello.py?因为仓库是大家共用的,
> 每个人都叫 hello.py 会互相覆盖——用文件夹隔离,谁都不打架。这也是真实团队协作的习惯。
## 完成标准
- [ ] 网页仓库里出现 `你的昵称/hello.py`
- [ ] 能说出来:clone / add / commit / push 分别做了什么
**提交方式**:把仓库里你那个文件的链接,贴在当日工单的评论里。