与谁同坐 發表於 2023-2-21 09:50:00

把本地vscode项目代码传到gitee上

<p>一、注册好gitee</p>
<p>二、安装好git</p>
<p>三、在gitee上创建好仓库</p>
<p>四、在本地做好相应工作&nbsp;</p>
<p> 启动git bash,做Git 全局设置(只需做一次):</p>
<p>设置前执行 :&nbsp;git config --list</p>
<p>如果已经有了这两项,就不用设置:</p>
<pre><strong><span>user.name=<span>XXX
user.email=XXX@XXX</span></span></strong><span><strong>.XXX</strong></span></pre>
<div class="cnblogs_code">
<pre>C:\Users\XXX&gt;git config --<span style="color: rgba(0, 0, 0, 1)">list
</span><span style="color: rgba(0, 0, 255, 1)">diff</span>.astextplain.textconv=<span style="color: rgba(0, 0, 0, 1)">astextplain
filter.lfs.clean</span>=git-lfs clean -- %<span style="color: rgba(0, 0, 0, 1)">f
filter.lfs.smudge</span>=git-lfs smudge -- %<span style="color: rgba(0, 0, 0, 1)">f
filter.lfs.process</span>=git-lfs filter-<span style="color: rgba(0, 0, 0, 1)">process
filter.lfs.required</span>=<span style="color: rgba(0, 0, 255, 1)">true</span><span style="color: rgba(0, 0, 0, 1)">
http.sslbackend</span>=<span style="color: rgba(0, 0, 0, 1)">openssl
http.sslcainfo</span>=D:/Program Files/Git/mingw64/ssl/certs/ca-<span style="color: rgba(0, 0, 0, 1)">bundle.crt
core.autocrlf</span>=<span style="color: rgba(0, 0, 255, 1)">true</span><span style="color: rgba(0, 0, 0, 1)">
core.fscache</span>=<span style="color: rgba(0, 0, 255, 1)">true</span><span style="color: rgba(0, 0, 0, 1)">
core.symlinks</span>=<span style="color: rgba(0, 0, 255, 1)">false</span><span style="color: rgba(0, 0, 0, 1)">
pull.rebase</span>=<span style="color: rgba(0, 0, 255, 1)">false</span><span style="color: rgba(0, 0, 0, 1)">
credential.helper</span>=<span style="color: rgba(0, 0, 0, 1)">manager
credential.https:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">dev.azure.com.usehttppath=true</span>
init.defaultbranch=<span style="color: rgba(0, 0, 0, 1)">main
core.editor</span>=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">D:\Program Files\Microsoft VS Code\bin\code</span><span style="color: rgba(128, 0, 0, 1)">"</span> --<span style="color: rgba(0, 0, 255, 1)">wait</span><span style="background-color: rgba(255, 255, 173, 1)"><strong><span style="color: rgba(0, 0, 0, 1)">
user.name</span>=<span style="color: rgba(0, 0, 0, 1)">XXX
user.email</span>=XXX@<span style="color: rgba(128, 0, 128, 1)">126</span></strong></span><span style="color: rgba(0, 0, 0, 1)"><span style="background-color: rgba(255, 255, 173, 1)"><strong>.com</strong></span>
credential.https:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">gitee.com.provider=generic</span></pre>
</div>
<p>&nbsp;没有设置启动git bash,执行下面代码:</p>
<pre class="dark">git config --global user.name "gitee用户名"
git config --global user.email "gitee邮箱名"</pre>
<p>五、打开 gitee新建仓库</p>
<p>设置仓库名,其他选项可以默认。</p>
<p>记下仓库地址:</p>
<p><span style="background-color: rgba(255, 255, 0, 1)">https://gitee.com/XXX/XXXXX.git&nbsp;</span></p>
<p><img src="https://img2023.cnblogs.com/blog/300900/202302/300900-20230221092810195-481549112.webp" alt="" width="529" height="576"></p>
<p>&nbsp;</p>
<p>六、vscode中设置</p>
<p>打开vscode</p>
<p>打开源代码管理器选择右上角三个点-&gt;远程-&gt;添加远程存储库:</p>
<p><img src="https://img2023.cnblogs.com/blog/300900/202302/300900-20230221094314619-747232103.png" alt=""></p>
<p>添加刚才的gitee仓库地址,然后可能需要填gitee 用户名和密码</p>
<p><img src="https://img2023.cnblogs.com/blog/300900/202302/300900-20230221094354141-1801983959.png" alt=""></p>
<p>以上仓库设置完成</p>
<p>七、上传项目</p>
<p>消息框中填写上传说明,必须填,随便填。</p>
<p>点对勾√-&gt; 提交(还有在填一次上传说明)完成。</p>
<p>&nbsp;</p>
<pre class="dark"><em id="__mceDel">&nbsp;</em></pre><br><br>
来源:https://www.cnblogs.com/liehuo123/p/17139901.html
頁: [1]
查看完整版本: 把本地vscode项目代码传到gitee上