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

相关推荐
CaptainDrake1 分钟前
Git 原理(提交对象)(结合图与案例)
git
CaptainDrake3 分钟前
Git:Git管理
git
PassLink_1 小时前
常用 Git 命令
git
想和我重名?2 小时前
Git的基本操作
git
慕羽★13 小时前
Git常用指令整理【新手入门级】【by慕羽】
linux·git·ubuntu·gitlab·github·仓库·分布式协作
鸡c14 小时前
etcd二次封装
git·github·etcd
救救孩子把14 小时前
UGit:腾讯自研的Git客户端新宠
java·开发语言·git
星叔15 小时前
git 压栈存储当前分支修改,出栈使用保存
git
狼魂豹速17 小时前
idea2024 Safe Mode解决、配置git出现Can‘t run a Git command in the safe mode、取消受信任项目功能
git
DN金猿19 小时前
git 问题 --- fatal: detected dubious ownership in repository at
git