- push失败,提示网络相关问题设置如下
git config --global http.proxy "localhost:1080"
- 设置用户名 邮箱
git config --global user.name 'xxxx'
git config --global user.email 'xxx@xx.com'
- 初始化仓库,进入一个目录
git init
- 添加文件
git add aa.txt
- 提交文件
git commit -m '提交说明'
- 提交历史
git log
- 当前版本库状态
git status
- 当前版本区别
git diff
- 查看所有commit id
git reflog
- 回到指定版本
git reset --hard commitid
- 回到上个版本
git reset --hard HEAD^
- 撤销修改
- 未添加到暂存区 未执行 git add
git checkout -- xx.txt
- 已执行git add
git reset HEAD xx.txt
git checkout -- xx.txt
错误解决
- git push提示 fatal: NotSupportedException encountered.
ServicePointManager ▒▒֧▒־▒▒▒ localhost ▒▒▒▒▒Ĵ▒▒▒
git config --global http.proxy "localhost:1080"
修改为
git config --global http.proxy "127.0.0.1:1080"
- git pull 提示 LF will be replaced by CRLF in
git config --global core.autocrlf false
禁止自动换行