
Github提交代码方法总结
1. 初始操作
echo "# supereditor" >> README.md
git init #初始化仓库
git add README.md #添加单个文件 省略后面的文件名是添加所有文件
git config --global user.name xxx #配置git
git commit -m "first commit" #将暂存区的更改提交到本地仓库,并附加提交说明
git branch -M main #将当前所在分支或指定分支强制重命名为 main
git remote add origin https:
git push -u origin main #推送代码
2. 如何设置代理
全局代理设置
git config --global http.proxy http:
git config --global https.proxy https:
只对GitHub进行代理
git config --global http.https:
git config --global https.https:
sock5代理设置
git config --global http.https:
git config --global https.https:
取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
查看已有配置
git config
来源:virtualcardx.com/2025/12/02/…