zoukankan      html  css  js  c++  java
  • Git使用

    GitHub 

       GitHub是一个用于版本控制协作代码托管平台

       GitHub官网地址—https://github.com/yangzhizong/-/branche

    GIT

      官网安装地址:https://www.git-scm.com/downloads 

    第一步git init (完成初始化)

    在当前项目工程下履行这个号令,相当于把当前项目git化

    在当前项目的目录中生成本地的git管理(我们会发现当前目录下多了一个.git文件夹)

    #先要切换到你指定的本地目录
    yaodong.hou@L-002627 MINGW64 /d
    $ cd python
    
    yaodong.hou@L-002627 MINGW64 /d/python
    $ cd git_use
    
    yaodong.hou@L-002627 MINGW64 /d/python/git_use
    $ ^C
    
    yaodong.hou@L-002627 MINGW64 /d/python/git_use
    $ git init
    Initialized empty Git repository in D:/python/git_use/.git/
    
    yaodong.hou@L-002627 MINGW64 /d/python/git_use (master)
    $

    运行完毕后,后在你指定的目录里面出现一个隐藏的 .git文件夹

    常用命令

    pwd查看当前所在目录

    yaodong.hou@L-002627 MINGW64 /d/python/git_use (master)
    $ pwd
    /d/python/git_use

    ls查看当前目录文件

    ls -al显示隐藏文件

    yaodong.hou@L-002627 MINGW64 /d/python/git_use (master)
    $ ls
    time1212.py


    第二步vim新建一个py文件验证提交到仓库,也可以用

    新建一个文件(验证提交到仓库操作)
    yaodong.hou@L-002627 MINGW64 /d/python/git_use (master)
    $ vim time1212.py

    status查看状态(Untracked显示git还未跟踪)

    yaodong.hou@L-002627 MINGW64 /d/python/git_use (master)
    $ git status
    On branch master
    
    No commits yet
    
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
    
            time1212.py
    
    nothing added to commit but untracked files present (use "git add" to track)
    
    yaodong.hou@L-002627 MINGW64 /d/python/git_use (master)
    $

    第三步git add + 文件名,把内容从工作区提交到暂存区

    注意:暂存区也是在本地

    yaodong.hou@L-002627 MINGW64 /d/python/git_use (master)
    $ git add time1212.py
    warning: LF will be replaced by CRLF in time1212.py.
    The file will have its original line endings in your working directory

    status再次查看状态 (状态变为等待被提交

    yaodong.hou@L-002627 MINGW64 /d/python/git_use (master)
    $ git status
    On branch master
    
    No commits yet
    
    Changes to be committed:    #等待被提交
      (use "git rm --cached <file>..." to unstage)
    
            new file:   time1212.py

    第四步:commit提交文件到仓库,git commit time1212.py -m "注释文件"

    待完善。。

  • 相关阅读:
    【5min+】 秋名山的竞速。 ValueTask 和 Task
    int16、int32、int64的范围
    C#实现的一些常见时间格式
    C# WPF抽屉效果实现(C# WPF Material Design UI: Navigation Drawer &amp; PopUp Menu)
    如何为.NETCore安装汉化包智能感知
    .NetCore学习笔记:三、基于AspectCore的AOP事务管理
    C#设计模式学习笔记:简单工厂模式(工厂方法模式前奏篇)
    .net core3.0 webapi搭建(一)
    [Abp vNext 源码分析]
    WPF 控件功能重写(ComboBox回车搜索)
  • 原文地址:https://www.cnblogs.com/yangzhizong/p/10107967.html
Copyright © 2011-2022 走看看