Git的基本使用


Git的基本使用

1.创建仓库
  登陆github帐号,创建远程仓库
  同步到本地
  生成key:
    ssh-keygen
    cat ~/.ssh/id_rsa.pub 将密钥复制到帐号的key
    git clone ---》克隆到本地仓库

基本使用命令
  git add .---->追踪
  git commit -m "备注" ---->提交到仓库
  git push ---->提交到远程仓库
  git pull ---->下载到本地仓库
  git status ---->查看仓库状态
  git log ----->查看仓库日志(id)
  git reset --hard id ----->切换到指定版本
  git reflog ----->查看最新版本日志
  git rm ----->删除

原文地址:https://www.cnblogs.com/Qingxiaoyu/p/10064590.html