有用命令

记录一些有用的命令

生成密钥

1
2
3
4
5
1. 在桌面打开Git Bash Here
2. git config --global user.name "yourname"
3. git config --global user.email "youremail"
4. ssh-keygen -t rsa -C "youremail"
5. 复制id_rsa.pub内容至公钥

查看用户名和邮箱地址

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

Windows10 开机自启动软件的目录

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

Windows上iTunes备份的位置

C:\Users\用户\AppData\Roaming\Apple Computer\MobileSync\Backup

Typora中文状态下输入英文符号

ctrl + .即可改回中文输入状态输出中文符号

MySQL连接远程数据库

1
mysql -h "host" -P 3306 -u root -p

MySQL在不清空数据的情况下重置id自增长

1
2
alter table 表名 drop id;
alter table 表名 add id int primary key not null auto_increment first;

强制关掉yum进程

1
rm -f /var/run/yum.pid

Hexo相关命令

上传文件的命令
1
2
3
hexo clean
hexo g
hexo d
新建文件的命令
1
hexo new "文件名"

Git忽略所有target目录

.gitignore文件中,写入target/即可。

注意!不可以写成/target/,如果这样写,只有.gitignore所在路径的target目录会被忽略。

.gitignore未生效

.gitignore只会忽略在.gitignore编写之后的未跟踪(untrack)文件,而在编写.gitignore之前已经add and commit的文件则不会被忽略

解决办法
1
git rm -r --cached .  //清除缓存

Cpolar启动命令

1
cpolar service start