Git常用命令

#查看项目的分支们(包括本地和远程)

命令行 : git branch -a

#删除本地分支

命令行 : git branch -d <BranchName>

#删除远程分支

命令行 : git push origin --delete <BranchName>

强制更新远程分支

git push -f -u origin xjzhang

#修改commit

git commit --amend

#修改已经提交的过的 commit

git commit --amend

// ... edit you message

git push --force example-branch

#合并 commit

git reset --soft "HEAD~n"

(~n means ~1, ~2,...)

git commit --amend

git 删除远端分支 报错remote refs do not exist的解决方法

git fetch -p origin

git pull 报 unable to update local ref 错误

git gc --prune=now

git remote prune origin

相关推荐
赵民勇16 分钟前
Git命令详解
git
不老刘19 小时前
Antigravity 的 New Worktree 模式:给 AI 代理一个安全的“平行工位”
人工智能·git·ai编程·antigravity
光谱SpectrAI19 小时前
Windows 也中招:Git Bash 和 Node 仍信任泄露的 eMudhra 证书
git
YIN_尹20 小时前
【git原理与使用】git初识与安装
大数据·git·elasticsearch
Leo_Mr1 天前
Vue3 项目配置 Git 提交规范(企业通用方案:husky + commitlint + cz-git + lint-staged)
git
jyOverQ1 天前
Git rebase 和 merge 有什么区别?什么时候该用哪个?
git
晗夜未央1 天前
跨仓库 Skill 换台电脑就失效?用 Git remote 校验项目
人工智能·git·python
Lsetea1 天前
Git访问HTTPS证书不受信任:用URL级sslCAInfo限定私有CA范围
git·https·开发工具·ssl证书·ca证书
এ慕ོ冬℘゜2 天前
Git 基础入门|和 SVN 对比 + 四大区域 + 常用命令详解
git·svn
DevLoom_2 天前
macOS 命令行 curl/git 报 SSL 证书错误?eMudhra 事件完整修复指南
git·macos·ssl