• git 常用命令


    命令名称 作用
    git config --global user.name  用户名 设置用户签名
    git config --global user.email 邮箱 设置用户签名
    git init 初始化本地库
    git status 查看本地库状态
    git add 文件名 添加到暂存区
    git commit -m "日志信息" 文件名 提交到本地库
    git reflog 查看历史记录
    git reset --hard 版本号 版本穿梭

    分支操作

    命令名称 作用
    git branch  分支名 创建新的分支
    git branch -v 查看当前分支
    git checkout 分支名 切换分支
    git branch -a 查看所有分支
    git branch -d 分支名 删除分支
    git merge 分支名 把指定的分支合并到当前分支上

     

    查看配置信息

    
    # 查看全局配置信息
    git config --list --global
    
    # 获取当前项目指定信息
    git config user.email
    # 获取全局指定信息
    git config --global user.name
    
    # 局部配置,针对具体项目,在项目目录下运行命令:
    
    git config user.name "worker95"
    git config user.email "worker95@work.com"
    
    # 查看项目的局部配置,在项目目录下运行:
    
    git config user.name
    git config user.email
    
    # 全局配置(只是多了一个--global参数):
    
    git config --global user.name "user95"
    git config --global user.email "user95@foxmail.com"

    分支

    # 创建新分支
    git checkout -b newB
    
    #查看当前分支
    git branch
    # 查看所有分支
    git branch -a  
    
    #切换分支 
    git checkout 分支名
    
    # 删除分支 
    git branch -d 分支名
  • 相关阅读:
    MT【296】必要性探路
    MT【295】线段比的仿射变换
    MT【294】函数定义的理解
    MT【293】拐点处切线
    MT【292】任意存在求最值
    MT【291】2元非齐次不等式
    MT【290】内外圆求三角最值
    MT【289】含参绝对值的最大值之三
    MT【288】必要性探路
    Xadmin-自定义字段支持实时编辑
  • 原文地址:https://www.cnblogs.com/niunai/p/16521072.html
Copyright © 2020-2023  润新知