Git初步使用—2

继上次的介绍

    关于Git初步使用——1

   1.回顾

        创建工作空间working directory(f:myProject)

        dos cmd cd 初始化工作空间

        git init

        创建readme.txt文件

        git add readme.txt    把文件添加到暂存区域

         git commint -m "提交说明" 把文件提交到仓库

    2.LICENSE.md

        添加mit license.md 许可说明

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

            Copyright (C) <year> <copyright holders>

  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and     associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation the rights to use, copy,     modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do     so, subject to the following conditions:
  
  The above copyright notice and this permission notice shall be included in all copies or substantial     portions of the Software.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,     INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO     EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,    
    DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,     ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
    OR OTHER DEALINGS IN THE SOFTWARE.     

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    3.查看git状态

        git status一下 

                

       然后 git add LICENSE.md 在执行git status

        

           

        如果想撤销 联想三棵树(工作区域,暂存区域,git仓库)

        撤销上一部操作

        git reset HEAD

        

        返回提交到暂存区域之前

        然后在git add LICENSE.md

                     

    然后在commit提交上去

    然后更改LICENSE.md 中所属人

    然后查看git状态 git status

    

    注意:说明LICENSE.md文件内容已经被修改了

               git 给出了两个处理办法     重新git add 文件

                                                        覆盖修改的 git checkout -- 文件  (文件前面有个空格)

                所有文件变绿状态 说明放在暂存区域 等待被提交到git仓库

                所有文件变红状态 说明放在工作区域等待被提交到暂存区域


        git log  查看提交的信息





猜你喜欢

转载自blog.csdn.net/weixin_38639270/article/details/80066854