Git的安装及其使用(一)
作者:互联网
<div class="clear"></div> <div class="postBody"> <div id="cnblogs_post_body" class="blogpost-body "> <h3 class="md-end-block md-heading md-focus"><span class="md-plain" style="font-family: 'Microsoft YaHei';">Git简介</span></h3> <p class="md-end-block md-p"><span class="md-plain" style="font-family: 'Microsoft YaHei';">Git 是一个开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目<span class="md-softbreak"> <span class="md-plain">Git 是 Linux Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件<span class="md-softbreak"> <span class="md-plain">Git 与常用的版本控制工具 CVS, Subversion 等不同,它采用了分布式版本库的方式,不必服务器端软件支持</span></span></span></span></span></p> <h3 class="md-end-block md-heading"><span class="md-plain" style="font-family: 'Microsoft YaHei';">安装Git</span></h3> <p class="md-end-block md-p"><span class="md-plain" style="font-family: 'Microsoft YaHei';">傻瓜式安装(一步到位)</span></p> <h3 class="md-end-block md-heading"><span class="md-plain" style="font-family: 'Microsoft YaHei';">配置Git</span></h3> <p class="md-end-block md-p"><span class="md-plain" style="font-family: 'Microsoft YaHei';">新安装git以后,做全局配置</span></p> <div class="cnblogs_code"> <pre><span style="color: #008000;">#</span><span style="color: #008000;"> 右键单击点击 Git Bash Here</span> git config --<span style="color: #0000ff;">global</span> user.name <span style="color: #800000;">"</span><span style="color: #800000;">foxes_love_sugar</span><span style="color: #800000;">"</span><span style="color: #000000;"> git config </span>--<span style="color: #0000ff;">global</span> user.email <span style="color: #800000;">"</span><span style="color: #800000;">742327252@qq.com</span><span style="color: #800000;">"</span></pre> </div> <p class="md-end-block md-p"><span class="md-plain" style="font-family: 'Microsoft YaHei';">第一次安装成功以后做的操作,以后不需要重复操作</span> </p> <h3 class="md-end-block md-heading"><span class="md-plain">Git</span><span class="md-plain" style="font-family: 'Microsoft YaHei';">基本操作命令</span></h3> <div class="cnblogs_code"> <pre><span style="color: #008000;">#</span><span style="color: #008000;"> 初始化</span> <span style="color: #000000;">git init </span><span style="color: #008000;">#</span><span style="color: #008000;"> 添加文件到缓存中</span> git add 文件名 <span style="color: #008000;">#</span><span style="color: #008000;"> 添加一个文件</span> git add . <span style="color: #008000;">#</span><span style="color: #008000;"> 添加全部文件</span> <span style="color: #000000;"> </span><span style="color: #008000;">#</span><span style="color: #008000;"> 提交文件,并添加提交说明</span> git commit -m <span style="color: #800000;">'</span><span style="color: #800000;">first commit</span><span style="color: #800000;">'</span><span style="color: #000000;"> </span><span style="color: #008000;">#</span><span style="color: #008000;"> 指定origin的提交地址</span> git remote add origin https://gitee.com/foxes_love_sugar/<span style="color: #000000;">FoxLovely.git </span><span style="color: #008000;">#</span><span style="color: #008000;"> 推送文件到 gitee 仓库,并指定分支,master为主分支</span> git push origin master</pre> </div> <h3 class="md-end-block md-heading md-focus"><span class="md-plain md-expand">重置 windows 凭据</span></h3> <div class="cnblogs_code"> <pre><!--若出现如下错误--><span style="color: #000000;"> remote: Incorrect username or password ( access token ) fatal: Authentication failed </span><span style="color: #0000ff;">for</span> <span style="color: #800000;">'</span><span style="color: #800000;">https://gitee.com/foxes_love_sugar/FoxLovely.git/</span><span style="color: #800000;">'</span> <!--解决方案--><span style="color: #000000;"> 进入控制版面(右键单击我的电脑,属性打开控制版面) 选择用户账户,管理Windows凭据 </span><!--注意:码云的用户名,是@符号后面的那个--><span style="color: #000000;"> foxes_love_sugar</span></pre> </div> <h3>过程</h3> <p><span class="md-image-before-src ty-focusable"><span class="md-image-src-span ty-focusable"><img src="https://www.icode9.com/i/l/?n=20&i=blog/2080776/202006/2080776-20200629194039215-435982645.png" alt="" loading="lazy"></span></span></p> <p> </p> <p> </p> <p><span class="md-image-before-src ty-focusable"><span class="md-image-src-span ty-focusable"> </span></span></p> <p><span style="font-family: 'Microsoft YaHei';"><span class="cm-variable"> </span></span></p> </div> <div id="MySignature"></div> <div class="clear"></div> <div id="blog_post_info_block"> <div id="blog_post_info"></div> <div class="clear"></div> <div id="post_next_prev"></div> </div> </div> <div class="postDesc">posted @ <span id="post-date">2020-06-29 16:37</span>
标签:git,love,及其,foxes,sugar,Git,gitee,安装 来源: https://www.cnblogs.com/qx1996liu/p/13210601.html