Hexo+GitHub静态博客超级详细搭建教程之git命令合集

释放双眼,带上耳机,听听看~!
本地 命令
初始化仓库 git init
查询分支 git branch
展示所有分支 git branch -a
删除本地指定分支 git branch -d <BranchName>
删除远程指定分支 git push origin --delete <BranchName>
拉取远程指定分支 git fetch origin <BranchName>:<BranchName>
查询当前git状态 git status
将变动加入暂存区 git add .
将暂存区里的改动给提交到本地的版本库 git commit -m "描述内容"
将改动推送到远程branch git push origin <BranchName>
仓库回滚指定commit版本 git reset --hard <commit id>// hard选项,表示彻底将工作区、暂存区和版本库记录恢复到指定的版本库
强制推送覆盖远程仓库内容 git push -f origin master
远程 命令
克隆仓库 git clone 地址
克隆仓库指定分支 git clone -b <BranchName> 地址
1. git pull/push时存储密码避免每次输入 git config --global credential.helper store
2. 编辑.gitconfig文件 [user] name = your github uesrname email = your github email [credential] helper = store
3. 生成的文件.git-credentials

给TA买糖
共{{data.count}}人
人已赞赏
全系教程

KinhDown – 最新免登录百度网盘资源高速直链解析下载器,支持Aria2c、Xdown、IDM

2020-9-9 22:45:29

全系教程

Xshell/Xftp更改用户数据文件夹正确姿势

2020-9-24 21:21:10

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索