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 
相关推荐
ALex_zry5 小时前
Git大型仓库推送失败问题解决方案:大文件传输优化指南
git
草莓熊Lotso5 小时前
Git 分支管理:从基础操作到协作流程(本地篇)
大数据·服务器·开发语言·c++·人工智能·git·sql
w***Q3508 小时前
Git工作流自动化
运维·git·自动化
舒一笑13 小时前
GitPulse:让代码的故事自己讲述
git·程序员·intellij idea
5***o50014 小时前
Git在代码中的GitHub
git·github
还是会想她15 小时前
git 常见命令
git
1***y17817 小时前
Git在发布流程中的自动化标签
运维·git·自动化
逻辑棱镜1 天前
Git 分支管理与提交信息规范 (v1.0)
git·github·团队开发·代码规范·敏捷流程
不悔哥1 天前
如何基于gitee新建仓库
gitee
悦悦欧呐呐呐呐1 天前
git 设置邮箱和用户名
git