其他
git的更新
git update-git-for-windows
账号登录
现在貌似下载自己代码仓库只用账号密码是不行的。
https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls
- 右侧栏
Settings
- 左侧栏滑到底
Developer Settings
- 左侧栏
Personal access tokens
然后随便弄一下。
分支问题
查看当前所有分支git branch
查看远程分支git branch -r
两种开分支的做法:https://www.cnblogs.com/qyf404/p/git_push_local_branch_to_remote.html
push和pull
我用的vscode,直接命令行git操作。
添加新文件就git add <新文件>
然后commit git commit <文件>
或者commit全部git commit .
vscode里先输入commit messages,然后 ^X离开,选择Y来保存,最后enter退出。
push:git push origin <分支名>
报错
git clone报错
挂了梯子但是仍然访问不了,可能是git没走梯子,所以要设置http和https的代理。
查看全局代理和当前仓库代理:
git config --global --get http.proxy
git config --get http.proxy
配置全局代理:
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy https://127.0.0.1:7890