推荐学习git

龙恩博客http://www.cnblogs.com/tugenhua0707/p/4050072.html#!comments

git命令大全 https://www.jqhtml.com/8235.html

自己常用git命令  

  • 0.ssh-keygen  -t rsa –C “youremail@example.com”登录github,打开” settings”中的SSH Keys页面,然后点击“Add SSH Key”,填上任意title,在Key文本框里黏贴id_rsa.pub文件的内容。
  • 1.git config --global user.name "your name"$ git config --global user.email"your_email@youremail.com"
  • 2.git init
    3.git add 文件
    4.git commit -m "解释"
    5 git status 状态
    6.git log 查看历史提交
    7.git reset HEAD~ 回退上一个快照(~~)两个~上上个快照
    8.git rm -f file名字 (rm删除文件 -f是删除全局所有的一样的文件)删除了工作区和暂存区 但是记录删除不了(git git reset --soft HEAD~)soft是修改指针,记录也就没了
    9.git rm --cached file名字 删除暂存区,保留工作区
    10.git mv 旧名字 新名字 ( 重命名)
    11 git branch 名字 创建新的分支
    12 git log --decorate (最近记录)
    13 git checkout 名字 (切换分支)或者 git checkout -b 名字创建并切换
    14 git log --decorate --oneline --graph --all (最近记录精简版)
    15 git merge 分支名 合并分支
    16 git branch -d 分支名 删除分支
    git config --list
  • git clone '仓库地址'
    git push
    git pull
原文地址:https://www.cnblogs.com/weiyf/p/10628098.html