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 
相关推荐
国家二级编程爱好者2 小时前
删除typora文档没有引用的资源文件
git·python
Rsun045516 小时前
Git相关面试题
git
rogerogers8 小时前
在 VS Code Remote SSH 中完美配置 GPG 自动签名 (macOS 到 Ubuntu 24.04)
git·visual studio code
qiuyuyiyang9 小时前
Nginx 反向代理之upstream模块以及完整配置反向代理示例
git·nginx·github
勇闯逆流河11 小时前
【Linux】Linux基础开发工具(git、dbg)
linux·运维·服务器·开发语言·c++·git
Wpa.wk11 小时前
IDE中配置Git常见操作
ide·经验分享·git·测试工具
Android系统攻城狮11 小时前
Android16进阶之MediaPlayer.setAudioAttributes调用流程与实战(二百三十六)
gitee·android16·音频进阶·android hal
NaCl鱼呜啦啦1 天前
Git 仓库损坏修复指南:从诊断到恢复
git
huazi991 天前
AI编程(一):Trae+Git 应用开发
git·ai编程·trae
Luna-player1 天前
springData
gitee