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 
    
相关推荐
2501_9032386513 分钟前
Git Bash:Windows下的强大命令行工具
windows·git·bash·个人开发
神明木佑2 小时前
datalist 是什么?以及作用是什么?
git
那片海还在吗4 小时前
使用 Git、Postman、Newman、Jenkins 与邮件构建自动化接口测试及通知流程
git·jenkins·postman
heeheeai12 小时前
git 国内源
git
the_seventh_dog12 小时前
git | 团队协作开发注意事项
git
yinshuilan15 小时前
今日运维之-Mac笔记本python环境问题
运维·git·python·brew
辄也16 小时前
git拉取远程分支到本地分支
git
皮克斯的进化之路16 小时前
Git原理+使用(超详细)
git
wrjwww16 小时前
【Git学习笔记】Git常用命令
笔记·git·学习
大乔乔布斯17 小时前
WSL,Power shell 和CMD, Git bash的区别
开发语言·git·bash