zoukankan      html  css  js  c++  java
  • git

    GIT是一个分布式版本管理系统,速度快,适合大规模,跨地区多人协同开。SVN是一个集中式版本管理系统。

    GIT分布式版本管理系统

    Gitlab git私库解决方案

    Github git公有库解决方案

    git安装

    Centos:

    yum install -y git

    Ubuntu:

    apt-get install git

    Windows安装git bash

    linux编译安装

    #安装依赖包
    [root@localhost ~]# yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
    
    [root@localhost ~]# unzip v2.7.4.zip
    [root@localhost ~]# cd git-2.7.4/
    [root@localhost git-2.7.4]# make prefix=/usr/local/git all
    [root@localhost git-2.7.4]# make prefix=/usr/local/git install
    [root@localhost git-2.7.4]# rm -f /usr/bin/git
    [root@localhost git-2.7.4]# ln -s /usr/local/git/bin/git /usr/bin/git
    [root@localhost git-2.7.4]# git --version
    git version 2.7.4

    初始化仓库

    [root@localhost ~]# mkdir test && cd test
    [root@localhost test]# git init
    [root@localhost test]# git config --global user.name "test"
    [root@localhost test]# git config --global user.email test@qq.com
    [root@localhost test]# git config --list
    user.name=test
    user.email=test@qq.com
    core.repositoryformatversion=0
    core.filemode=true
    core.bare=false
    core.logallrefupdates=true
    四个区域:
    远程仓库<-->本地仓库<-->暂存区域<-->工作目录
    四种状态
    Untracked、Unmodified、Modified、Staged
    Untracked(工作目录)-->git add -->Staged(暂存区)-->git commit版本-->Unmodified(本地仓库)-->Edit file-->Modified-->Stage the file-->Staged
    常用命令
    git add 加入暂存
    git status 查看状态
    git status -s 状态概览
    git diff 尚未暂存的文件
    git diff --staged 暂存区文件
    git commit 提交更新
    git reset 回滚
    git rm 从版本库中移除
    git rm --cached README 从暂存区中移除
    git mv 相当于mv git rm git add 三个命令

    分支命令

    git branch例出分支
    git branch -v
    git branch --merged查看哪些分支被合并
    git branch --no-merged查看哪些分支未被合并
    git branch -d testling删除分支
    git checkout切换分支
    git merged融合分支
    
    
  • 相关阅读:
    [转]Delphi DLL的创建、静态 以及动态调用
    Delphi txt文件的操作(读取、写入)
    为什么要使用动态链接库(DLL)
    TStringGrid 实现下拉框
    Ryzen 4000'Vermeer' CPU和Radeon RX'Big Navi'图形卡
    AMD Ryzen 5000‘Cezanne’APU
    AMD–7nm “Rome”芯片SOC体系结构,支持64核
    ARM Cortex-M嵌入式C基础编程(下)
    ARM Cortex-M嵌入式C基础编程(上)
    基于ARM Cortex-M的SoC存储体系结构和实战
  • 原文地址:https://www.cnblogs.com/yuezhimi/p/10684790.html
Copyright © 2011-2022 走看看