龙恩博客http://www.cnblogs.com/tugenhua0707/p/4050072.html#!commentshtml
git命令大全 https://www.jqhtml.com/8235.htmlgit
本身经常使用git命令 github
- 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