• 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 "注释文件"

    待完善。。

  • 相关阅读:
    Hosts
    Jupyter notebook 文件路径
    [GDAL]在三维场景中显示DEM
    [GDAL]编译64位GDAL1.10
    ArcEngine几何变换中的策略模式
    AE Scene开发中的观察者模式
    象限角和方位角
    帧率控制和渲染帧率
    [3D]1.绘制三角形
    CSLA.Net学习(2)
  • 原文地址:https://www.cnblogs.com/yangzhizong/p/10107967.html
Copyright © 2020-2023  润新知