git 常用命令 git怎么撤销命令 持续更新中!!!!

基本流程

bash 复制代码
# 拉取仓库
git clone 仓库地址
# 拉取最新版本
git pull
# 本地提交
git add .
git commit -m "本次提交信息!"
# 推送上云
git push

分支

bash 复制代码
# 创建分支
git checkout -b cart
# 删除本机的分支
git branch -d cart
# 切换分支 本地切换到主分支
git checkout master
# 合并cart
git merge cart

配置

bash 复制代码
# git 配置
git config --global user.name "bobby"
git config --global user.email "liyao.pinner@gmail.com"

clone

拉取仓库

bash 复制代码
# 拉取仓库
git clone 仓库地址

add

bash 复制代码
# 代码add
git add .
# 项目同步到本地
git clone ...
# 查看文件状态
git status
# 撤销所有add
git reset .

commit

bash 复制代码
# 撤销commit
git reset --soft HEAD^
# 撤销commit+add(有丢失文件风险)
git reset --hard HEAD^
# 代码commit
git commit
git commit -m "本次提交信息"
# commit 和上次合并
git commit --amend

push

推送上云

bash 复制代码
# 本机的cart分之推送到origin的cart分支
git push origin cart
# 代码push
git push

感谢大家的观看!!!创作不易,如果觉得我写的好的话麻烦点点赞👍支持一下

相关推荐
kobe_OKOK_12 分钟前
【团队开发】git 操作流程
git·elasticsearch·团队开发
码农垦荒笔记14 分钟前
Git 安装闭坑指南(仅 Windows 环境)
windows·git
CC码码10 小时前
管理你的多个 Git 密钥(多平台多账号)
git·gitlab·github
CC码码10 小时前
管理你的多个 Git 密钥(单平台多账号)
git·gitlab·github
大卫小东(Sheldon)10 小时前
GIM 1.5发布了! 支持Windows系统了
git·ai·rust
flying jiang10 小时前
将大仓库拆分为多个小仓库
git
李boyang10 天前
Git(四):远程操作
git
荻野泽溪10 天前
Git新建分支并同步到远程
git
漫步企鹅10 天前
【Git】新建一个远程分支的常规操作
git·新建远程分支
潇-xiao10 天前
Linux下的版本控制器Git(15)
linux·笔记·git