欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Git常用设置

程序员文章站 2022-07-02 20:27:41
...

设置姓名和邮箱

git config --global user.name “”
git config --global user.email “@163.com”

设置代理

国内Git虽然没有屏蔽,但用 git clone 时,网速大部分都在20KiB/s以下,可以设置代理方式加速

命令行执行:

git config --global http.proxy socks5://127.0.0.1:2066

git config --global https.proxy socks5://127.0.0.1:2066

git config --global http.proxy http://127.0.0.1:2067

git config --global https.proxy https://127.0.0.1:2067

设置被写入用户家目录中的.gitconfig文件里

取消代理

git config --global --unset http.proxy

git config --global --unset https.proxy

回滚到之前版本

git log # 查看日志,找到想要回滚的ID
git reset xxx
git stash
git push -f  # 需要加 -f 参数强制push
相关标签: 技巧

上一篇: Linux环境RabbitMQ安装

下一篇: 项目