欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

git 工具窗口使用命令

最编程 2024-10-15 12:34:09
...

git工具的使用

  1. 配置用户身份
  git config --global user.name = ''
  git config --global user.email= ''
  1. 初始化仓库
   git  init 'path路径'
  1. 提交暂存区
   git add . // .:代表当前目录
如何在本地去掉:
git restore  -staged  文件名
  1. 提交本地库
git commit -m ' 提交填写信息' 
当提交出现错误:
git reset _hard  '提交ID'   // ID 在 日志中查询前7位
  1. 查看历史
   git log
  1. 回溯历史
   git reflog
  1. 查看分支
   git branch
  1. 创建分支
   git branch '分支名称'
  1. 切换分支
   git checkout '分支'
  1. 分支合并
git merge '分支'
  1. 冲突解决
    1.git pull 

    2.git push 

    3.解决冲突(人工变更文件)

    4.git push
  1. 查看git配置

    git config -L(小写)
    
  2. 校验状态

    git status
    
  3. 查看远程仓库

  4. git remote
    
  5. 创建远程仓库(origin )

    git remote add origin 'git仓库网址'
    
  6. 推送远程仓库

  7. git push -u origin  master
    
  8. 远程拉取

    git pull