千里关山暮 發表於 2025-5-10 13:24:00

Git 上传 Github 光速入门教程

<h3 id="配置用户名与邮箱">配置用户名与邮箱</h3>
<pre><code>git config --global user.name "你的GitHub用户名"
git config --global user.email "你的GitHub注册邮箱"
</code></pre>
<h3 id="创建新-repo">创建新 repo</h3>
<p>在 Github 创建新的 repo。</p>
<h3 id="提交">提交</h3>
<pre><code>cd 你的项目文件夹路径# 进入项目目录
git init            # 初始化 Git 仓库
git add .         # 添加所有文件(或指定文件名)
git commit -m "第一次提交"# 提交并添加注释
git remote add origin https://github.com/你的用户名/仓库名.git
git push -u origin master
</code></pre>
<h3 id="代理设置">代理设置</h3>
<p>设置代理</p>
<pre><code># 假设代理地址是 127.0.0.1:7890(根据你的工具调整)
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890
</code></pre>
<p>取消代理</p>
<pre><code>git config --global --unset http.proxy
git config --global --unset https.proxy
</code></pre>
<h3 id="后续更新代码">后续更新代码</h3>
<pre><code>git add .
git commit -m "更新说明"
git push
</code></pre><br><br>
来源:https://www.cnblogs.com/qianxiquq/p/18869522
頁: [1]
查看完整版本: Git 上传 Github 光速入门教程