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

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

相关推荐
i建模12 小时前
git克隆加速方法大全
git
无限进步_12 小时前
【C++】私有虚函数与多态:访问权限不影响动态绑定
开发语言·c++·ide·windows·git·算法·visual studio
蜡台12 小时前
Git stash、reset、 cherry-pick 、revert 、reflog 常用命令使用说明
大数据·git·搜索引擎
君穆南1 天前
基于 NFS 与 Rsync 实现跨服务器 Seafile 数据平滑迁移实战
linux·运维·git
Jurio.1 天前
本机开发 + 多机执行的极简远端运行工具
linux·git·python·github·远程工作
阿巴~阿巴~1 天前
Git版本控制完全指南:从入门到实战(简单版)
linux·服务器·git
遇满则缺1 天前
新手第一次使用gitee全流程(附上常见错误以及解决方法)
git·gitee
SKILL·NULL1 天前
如何为GIT设置全局勾子,为每次提交追加信息
git
不做超级小白1 天前
开源项目二开为何推荐使用 `git clone --depth 1`?
git·开源
星晨雪海1 天前
Idea中使用Git详细教程
git