git常用流程控制命令
git init
创建本地仓库
git config --global user.name "Your Name"
设置git名字
git config --global user.email "email@example.com"
设置邮箱地址
git clone
下载远程仓库到本地
git clone -b 分支名 仓库地址
下载指定分支到本地
git add <file>
暂存文件
git commit -m <message>
提交暂存文件
git pull
抓取远程仓库所有分支更新并合并到本地
git push
将本地分支推送到远程分支
分支操作
git branch
命令用于列出,创建或删除分支
git checkout <name>
切换分支
git merge <name>
合并某分支到当前分支
git branch -d <name>
删除指定分支
git fetch
从远程分支拉更新到本地
git reset --hard 版本号
退回到指定版本
git rm <file>
从版本库中删除文件
git reset <file>
从暂存区恢复到工作文件
日志状态
git status
查看版本状态
git log
命令用于显示提交日志信息
标签管理
git tag <name>
打标签
git tag
查看所有标签
git tag -d <name>
删除指定标签
网友评论