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 
相关推荐
素雪风华4 小时前
Jenkins+Gitee+Docker容器化部署
java·docker·gitee·jenkins·springboot·持续部署
Casia_Dominic7 小时前
【三维重建工具】NeRFStudio、3D GaussianSplatting、Colmap安装与使用指南
git·3d·github·点云
构建的乐趣7 小时前
运行ssh -T git@github.com报错
git·ssh·github
落雪小轩韩20 小时前
Git 常用操作与注意事项全攻略
大数据·git
winds~20 小时前
【Git】git的回退功能
大数据·git·elasticsearch
Ring__Rain20 小时前
git fetch的使用
git
b1ng1 天前
新人程序员 Git 一站式指南
git·github
程序员的世界你不懂1 天前
IDE 关联 Git 操作
ide·git
weixin_428498491 天前
Git Submodule 介绍和使用指南
git
jingshaoqi_ccc2 天前
GitKraken最后一个免费版本和下载地址
git·github·gitkraken·版本管理工具