自学内容网 自学内容网

git工具窗口使用命令

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 
    

原文地址:https://blog.csdn.net/Crowd_chips/article/details/142928387

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!