用github来搭建个人技术笔记,少不了记录一些常用的git命令
Git
克隆库
1 | git clone https://github.com/geosmart/geosmart.io |
新建 ‘gh-pages’分支,会自动生成github pages
1 | git checkout --orphan gh-pages |
本地提交
1 | git commit -a -m "commit message" |
初始版本提交
1 | git push --set-upstream origin master |
推送到服务器
1 | git push origin |
git sync
git config —global credential.helper store
git config —global push.default matching1
2
3
4
5
6
7
8
9# git bash记住密码
## 设置环境变量
在windows中添加一个HOME环境变量,变量名:HOME,变量值:%USERPROFILE%
## 创建git用户名和密码存储文件
进入%HOME%目录,新建一个名为 "_netrc" 的文件,文件中内容格式如下:
```yaml
machine {git account name}.github.com
login your-usernmae
password your-password
重新打开git bash即可,无需再输入用户名和密码
查看git配置
1 | git config --list |
问题记录
CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
You have to fix the path to bin/curl-ca-bundle.crt. I had to specify the absolute path, using back-slashes:git config --system http.sslcainfo "C:\Program Files (x86)\git\bin\curl-ca-bundle.crt"``
or — not really recommended — you may choose to switch off SSL checks completely by executing:
git config —system http.sslverify false`