总体使用流程

先在文件夹里打开cmd
按照这个流程提交文件

1
2
git add .
git commit -m ""

然后使用

1
git push

输入账号和密钥之后就可以了。

本地在线调试

进文件夹然后

1
hexo server

就行了

报错处理大合集

输入账号密码的时候出错

1
2
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/Anjin001/Anjin.git/'

git已经不能直接用密码登录要使用密钥,去github自己仓库设置里面建一个classic的token,必须得是classic的,自用的把权限拉满就行。

git push时出错

1
fatal: unable to access 'https://github.com/': Failed to connect to 127.0.0.1 port 7890: Connection refused

解绑一下代理服务器或者开一下加速器

1
2
git config --global --unset http.proxy
git config --global --unset https.proxy
1
2
remote: Permission to --- denied to ---
fatal: unable to access 'https://github.com/': The requested URL returned error: 403

搞忘了看日志没看见怎么解决的,应该是前面那个密钥建错了没权限了

add的时候出问题

1
2
3
4
warning: LF will be replaced by CRLF in source/album/friends/index.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in source/album/withfriends/index.md.
The file will have its original line endings in your working directory

linux和windows换行的转换问题

1
git config --global core.autocrlf false

可以解决

日常会用到的命令

1
2
git config --global user.name
git config --global user.email

可以看用户名账号

1
dir /od /b

windows提取文件名,按照时间排序,dir可以输出全部内容