git day01

 

  • git官网地址:https://git-scm.com/
  • verson control system
     Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. 
    记录文件变化的 并且 之后可以指定版本进行恢复
    • 论文
      • xxx_v1.doc
      • xxx_v2.doc
        ....
      • xxx_最终版.doc 
    • 种类
      • Local Version Control Systems: copy files into another directory
        • 优点:so simple
        • 缺点:  error prone (代码集成效率低下)
      • Centralized Version Control Systems 集中式版本控制系统: 
        • 解决: 代码集成效率低下 多人协同开发的问题
        • 问题: single point 单点故障
      • Distributed Version Control Systems: 
        解决: 多人协同开发 单点故障
        • clients
        • server
  • git
    • efficiency
    • performance
    • 分支操作、文件配置、定制工作流程
  • 文件版本控制
    • 本地仓库
    • 远程仓库
  • 部署
    • 下载
    • 安装
    • 使用
      • git软件工具
        • 可视化界面的方式进行操作:git原理
        • git命令操作 == 和linux命令差不多
          linux和git都是林纳斯发明的
    • git命令
      • 查看git版本
        • $ git -v
          git version 2.38.1.windows.1

          使用前的配置--要配置我们的项目开发人员的信息
          & git config --global user.name "yaoyuzhe"
          & git config --global user.email "yaoyuzhe@qq.com"
  • Config file locatin
    • --global      use global config file          :对当前用户 所有仓库有效
    • --system    use system config file        :对系统所有登陆用户有效
    • --local        use repository config file    :对某个仓库有效  【优先级最高】
  • 查看配置参数
    • git config --list
    • git config --list --global
    • git config --list --local
  •  创建仓库
    •  项目:开发的代码文件
    • 仓库:本地仓库 用于进行文件的版本控制的
    • git init: 
      •  创建一个仓库
      • 重新初始化一个 以及存在的仓库

        git init [-q | --quiet] [--bare] [--template=<template-directory>]
                  [--separate-git-dir <git-dir>] [--object-format=<format>]
                  [-b <branch-name> | --initial-branch=<branch-name>]
                  [--shared[=<permissions>]] [<directory>]
            
         git init [<directory>]
  • 项目
    • 存在
      • cd 项目目录
      • git init
    • 不存在
      • git init <project_name>
      • git init test01
  • 使用
    git 管理版本控制的工作流程
    •  工作区: 项目目录
    • 暂存区: 临时存储文件的地方 可以进行撤回
    • 本地仓库:版本控制
  • 入门
    • vim 1.log
    • git add 1.log                       :添加到缓存区
    • git commit -m "Add 1.log"  :添加到本地仓库
    • git log                                 :查看本地仓库历史
  • 切换版本
    • git reset --hard [<commit>]
    • git reset --hard d7db6e

      git log --reset       :查看以前历史

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值