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

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

相关推荐
fendouweiqian3 小时前
git提交与commitlint规则
git
C.咖.11 小时前
Linux环境下——Git 与 GitHub
linux·git·github·远程仓库
杂鱼豆腐人13 小时前
pnpm环境下防止误使用npm的方法
前端·git·npm·node.js·git bash
摇滚侠14 小时前
GIT版本管理工具轻松入门 | TortoiseGit,Git 介绍软件安装配置,笔记01
笔记·git
山有木兮木有枝_16 小时前
“误操作导致 feat 功能未生效,尽管 merge 已完成”
git
百锦再16 小时前
第14章 智能指针
android·java·开发语言·git·rust·go·错误
摇滚侠16 小时前
GIT版本管理工具轻松入门 | TortoiseGit,解决冲突,笔记07
笔记·git
一点事1 天前
windows:git下载安装
git
不说别的就是很菜1 天前
【前端面试】Git篇
前端·git
~~李木子~~1 天前
通过git上传项目到码云和GitHub操作手册
git·gitee·github