*git
配置”
git config
git config --global user.name “”
git cofig --global user.email
基本操作
git init 创建版本仓库
git add . 将文件添加到版本库
git commit -m “内容”
git diff 查看仓库中具体修改
git log 查看仓库提交记录
git log --pretty=oneline 单行显示
git reflog 查看命令历史
git reset --hard 版本回退
git reset --hard HEAD^ 回退到上个版本
git rest --hard HEAD^回退到上上个版本
git reset --hard commit_id 回退到指定版本
撤销修改
-git checkout --file 丢弃工作区的修改
-git rest HEAD file 丢弃已经进入缓存的修改
git rm file 删除文件
分支管理
查看分支
git branch 本地分支
git branch -v 本地分支+详情
git branch -av 本地和远程
创建分支 git branch branchname
切换分支 git checkout branchanme
创建并切换分支 git checkout -b branch -b branchname
合并分支 git merge
删除分支 git branch -d
远程仓库
添加仓库 git remote add
推送本地仓库发哦远程仓库 git push
从远程仓库克隆到本地 git clone
修改远程仓库地址 git remote set -url
获取远程仓库的变更
git fetch
git pull
查看远程仓库信息 git remote -v
建立本地仓库和远程分支的关联
git branch --set–upstream origin /
git branch --set–upstream-to=origin/wang
删除远程分支 git push origin --delete branchname