git学习笔记
git config --global user·name " " --用户名称
git config --global user·email ... --用户邮箱
git init --初始化
git add 文件名 --提交到缓存区
git commit -m '注释' --提交到仓库
git status -s --查看项目当前状态
git diff 文件名 --查看修改后的详细信息
git rm --移除文件
git branch 分支名 --创建分支
git checkout 分支名 --切换分支
git branch --查看所有分支
git branch -d 分支名 --删除分支
git merge 分支名 --分支合并到当前分支
git log --提交历史
git reset --hard HEAD^ --回退上个版本
git reset --hard HEAD~n --回退n个版本
git reflog --获取版本号
git reset --hard 版本号 --恢复最新版本
git checkout -- 文件名 --撤销修改
git tag 标签名 --新建标签
git tag --查看所有标签
git tag -d 标签名 --删除标签
git tag -a 标签名 -m "注释" 版本号 --某一版本加标签
ssh-keygen -t rsa -C "github账号" --登录github获取公钥
git remote -v --查看项目远程地址
git remote rm origin --删除origin远程地址
git remote add origin github库名 --关联github远程库
git push -u origin master --本地库推送到github远程库(首次带参数-u)
git remote set-url github远程仓库地址 --修改远程库地址
git log --oneline --decorate --graph --查看版本号丶标签丶注释