Git基操
# 克隆默认分支(master)
git clone 地址
# 克隆指定分支
git clone -b 分支名称 地址
# 拉取
git pull
# 添加指定文件到仓库
git add '文件名'
# 添加所有文件到本地暂存区
git add * 或 git add all
# 提交到本地仓库
git commit -m "注释"
# 修改提交过的备注
git commin -amend
# 将本地的仓库推到远程仓库
git push
# 本地git仓库的代码推送到指定码云远端仓库中
git push origin 分支名
# 查看历史记录
git log
# 查看历史版本号(版本号用于进行版本回退
git log --pretty=oneline
# 回退历史版本(回到想回到的历史版本)
git reset --hard 版本号
# 查看历史命令
git reflog
# 查看状态
git status
# 创建分支
git branch "分支名"
# 切换分支
git checkout "分支名"
# 查看所在分支
git branch
# 合并某个分支到当前分支
git checkout master # 切回到master主分支上
git merge dev # 将dev分支合并到master分支上
# 删除分支
git branch -d "要删除的分支名"
浙公网安备 33010602011771号