git工具窗口使用命令

git工具的使用

  1. 配置用户身份
typescript 复制代码
  git config --global user.name = ''
  git config --global user.email= ''
  1. 初始化仓库
typescript 复制代码
   git  init 'path路径'
  1. 提交暂存区
typescript 复制代码
   git add . // .:代表当前目录
复制代码
如何在本地去掉:
typescript 复制代码
git restore  -staged  文件名
  1. 提交本地库
typescript 复制代码
git commit -m ' 提交填写信息' 
复制代码
当提交出现错误:
php 复制代码
git reset _hard  '提交ID'   // ID 在 日志中查询前7位
  1. 查看历史
typescript 复制代码
   git log
  1. 回溯历史
typescript 复制代码
   git reflog
  1. 查看分支
typescript 复制代码
   git branch
  1. 创建分支
typescript 复制代码
   git branch '分支名称'
  1. 切换分支
typescript 复制代码
   git checkout '分支'
  1. 分支合并
typescript 复制代码
git merge '分支'
  1. 冲突解决
typescript 复制代码
    1.git pull 

    2.git push 

    3.解决冲突(人工变更文件)

    4.git push
  1. 查看git配置

    复制代码
    git config -L(小写)
  2. 校验状态

    复制代码
    git status
  3. 查看远程仓库

复制代码
    git remote
  1. 创建远程仓库(origin )

    复制代码
    git remote add origin 'git仓库网址'
  2. 推送远程仓库

复制代码
    git push -u origin  master
  1. 远程拉取

    复制代码
    git pull 
相关推荐
Klaus_Wei6 小时前
git 高级命令模式典型应用--“同步云端 + 清理垃圾分支”的一键命令
git·git高级用法·git同步云端·git清理垃圾分支
妙娲种子7 小时前
配置git/创建第一个智能相册保存快照
git
what_20187 小时前
git一个账号在两台电脑登录 出现不同用户名
git
困鲲鲲8 小时前
ROS2系列 (13) : 常用Git指令入门(本地Git)
git·ros2
☆cwlulu12 小时前
git分支管理详解
开发语言·git·青少年编程
脑子不好的小菜鸟15 小时前
用vscode连接远端ubuntu无法git push,vscode无法连接centos
git·vscode·ubuntu·centos
__Witheart__16 小时前
Git 如何修改已有的分支名称
git
秦jh_19 小时前
【git】分支管理
git
百锦再1 天前
第5章 所有权系统
运维·git·python·eclipse·go·github·负载均衡
DW_DROME1 天前
git worktree (镜像站加速)
git