安装Git
Git官网
根据自己的系统下载安装。
Git学习
- 基本配置
- 打开Git Bash
- 设置用户信息(设置你的用户名和邮箱)
git config --global user.name “username”
git config --global user.name"hello@gmail.com"
查看配置信息
git config --global user.name
git config --global user.name - 为Git设置代理
打开电脑–>设置–>网络和Internet–>手动设置代理–>编辑–>查看代理端口(可能是7890)
打开git bash,输入指令
git config --global http.https://github.com.proxy http://127.0.0.1:7890
git config --global https.https://github.com.proxy https://127.0.0.1:7890
- 获取本地仓库
- 选择一个空目录作为Git仓库
- 进入这个目录中,点击右键打开Git bash窗口
- 执行命令git init
- 如果创建成功后可在文件夹下看到隐藏的.git目录
- 基础操作
- git add (工作区 --> 暂存区)
- git commit (暂存区 --> 本地仓库)
- 分支
- 查看本地分支