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 
相关推荐
7177779 小时前
开源代码审计平台推荐:Gitee 在企业代码审计流程中的定位与选型建议
人工智能·gitee
墨白曦煜10 小时前
穿透 IDE 的障眼法:Git 四大工作区与核心数据流转解析
ide·git
71777710 小时前
代码审计工具有哪些:面向 Gitee 生态的对比选型参考
gitee
idealzouhu12 小时前
深入 Git 账户模型:从提交身份到 SSH 多账户隔离的完整实践
git·ssh
是2的10次方啊12 小时前
误推 master 该 revert 还是 reset?撤销与补 MR 流程
git
菠萝加点糖1 天前
Git 删除远程文件、本地保留并取消跟踪
git
理智.6291 天前
Git 工具使用之项目版本回退与修改备份:stash、reset、reflog 常用指令详解
git·gitee·github
妙码生花1 天前
GIT 提交规范
git
云雀衔光1 天前
多个 MCP Server 怎么编排:数据库 / Redis / Git / 飞书一把梭
java·数据库·人工智能·redis·git·语言模型·飞书
Java后端的Ai之路2 天前
Git pull弹出vim编辑器完整排查指南
开发语言·人工智能·git·编辑器·vim