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 
相关推荐
康一夏27 分钟前
Git Commit 规范实践:Angular Commit 规范 + Commitlint 自动化验证
git·自动化·commit msg·commit规范
LayZhangStrive4 小时前
Git - 使用IDEA和git上传本地项目到Gitee远程仓库
git·gitee·idea
云泽8085 小时前
Git 版本控制系统(上):架构原理与操作入门
linux·git·架构
绝世唐门三哥5 小时前
Git - git stash 语法演进与实战指南
前端·git
梨想橙汁6 小时前
Git 分支详解:创建切换、合并分支、冲突解决实战
前端·git
菠萝加点糖8 小时前
Android applicationIdSuffix 详解
android·gitee·kotlin
扶苏10021 天前
gitee码云删除仓库教程
gitee
那年窗外下的雪.1 天前
AIDC 学习日志|第 21 天|EVPN 多归属故障演练与中断窗口定位
网络·git·学习
水巷石子1 天前
目前最新版本PicGo上传图片到gitee仓库具体配置
gitee·上传·typora·picgo·图片
玖石书1 天前
Git Submodule 完全指南:从添加到日常维护的常规操作全流程
大数据·git·elasticsearch