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 
相关推荐
极小狐23 分钟前
极狐GitLab 项目功能和权限解读
运维·git·安全·gitlab·极狐gitlab
极小狐29 分钟前
极狐GitLab 如何 cherry-pick 变更?
人工智能·git·机器学习·gitlab
前端太佬3 小时前
从拧螺丝到造火箭:Git高阶玩家生存报告
前端·git·github
前端太佬3 小时前
从青铜到塑料:Git逃难指南(附救命指令大全)
前端·git·github
Athel3 小时前
git 建立本地仓库并且推送到github上
git
李菠菜3 小时前
Windows Terminal 集成 Git Bash 的简洁配置指南
windows·git
高级IT技术专家secops9984 小时前
在统信UOS/麒麟Kylin OS操作系统中配置APT和GIT代理
运维·服务器·git·系统安全·kylin
信号处理学渣5 小时前
Git命令行中vim的操作
git·编辑器·vim
Connie14515 小时前
git tag使用场景和实践
git
还是鼠鼠7 小时前
Android移动应用开发入门示例:Activity跳转界面
android·前端·gitee·android studio·android-studio