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 
相关推荐
无限进步_3 小时前
【C++】重载、重写和重定义的区别详解
c语言·开发语言·c++·ide·windows·git·github
历程里程碑3 小时前
1 . Git本地操作:版本控制 跨平台协作 仓库核心
java·开发语言·数据结构·c++·git·gitee·github
华科大胡子3 小时前
Git + 云原生
git
johnny2333 小时前
Git拓展:GitButler、Gitnuro、JGit
git
王的宝库4 小时前
GitLab 常用 Git 命令新手指南
git·学习
马优晨5 小时前
git restore --source 提交id 和 git reset --hard 提交id 有什么区别
git·git reset·git restore·git回退的区别·git回退代码
小臭希6 小时前
Git(代码版本控制系统)
java·git·github
Unity粉末状在校生15 小时前
Git解决fatal: Could not read from remote repository.的问题
git
少年攻城狮15 小时前
Obsidian系列---【如何使用obsidian同步到git?】
git
为何创造硅基生物16 小时前
ESP32 IDF 编译时出现gitee 登录,导致编译报错
gitee