Git使用
1.安装成功后运行‘Git Bash’
2.点击后弹出命令框
3.查看账号,邮箱
命令 git config user.name
git config user.email
4.设置账号,邮箱
命令 git config --global user.name '账号'
git config --global user.email '邮箱'
5.生成秘钥ssh
命令 ssh-keygen -t rsa -C '邮箱'
点击三次回车
说明安装成功
()中的地址为秘钥在你本机的存储位置
5.查看秘钥ssh
命令 cat ~/.ssh/id_rsa.pub
6.把生成的秘钥添加到Git中
7.在电脑中创建一个Git仓库
命令 git init 将指定文件夹设置为可管理的仓库
8.Git文件操作命令
git add
把文件添加到暂存区
git commit -m '提交'
把文件提交到仓库,引号中为注释
git status
查看文件状态
git restore -- filename
撤销对未提交文件的修改
rm filename
删除文件