git中文版
1. git push 输入密码
- 利用
git-credentials
touch .git-credentials vim .git-credentials https://{username}:{password}@github.com
ssh
密钥
然后将ssh-keygen -t rsa -C "youremail"
~/.ssh/id_rsa,pub
复制到github中。
2. .gitignore
一些规则
# 忽略 .a 文件
*.a
# 但否定忽略 lib.a, 尽管已经在前面忽略了 .a 文件
!lib.a
# 仅在当前目录下忽略 TODO 文件, 但不包括子目录下的 subdir/TODO
/TODO
# 忽略 build/ 文件夹下的所有文件
build/
# 忽略 doc/notes.txt, 不包括 doc/server/arch.txt
doc/*.txt
# 忽略所有的 .pdf 文件 在 doc/ directory 下的
doc/**/*.pdf
3. 修改远程仓库地址
```
git remote rm origin
git remote add origin [url]
```
4. 设置代理
1、使用命令
http代理:
git config --global https.proxy http://127.0.0.1:10800
git config --global https.proxy https://127.0.0.1:10800
socks5代理:
git config --global http.proxy 'socks5://127.0.0.1:10800'
git config --global https.proxy 'socks5://127.0.0.1:10800'
2、编辑文件~/.gitconfig
在文件添加:
[http]
proxy = socks5://127.0.0.1:10800
[https]
proxy = socks5://127.0.0.1:10800
然后就可以直接使用git命令重新下载了。
取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy