git 解决ahead behind分叉以及删除远端commit
- 解决ahead / behind
先reset到ahead,然后退回到分叉,再checkout 远端的behind
如果要删除本地的commit, 先到本地的最前端, 然后再用下面的命令
If you want to fix up your latest commit, you can undo the commit, and
unstage the files in it, by doing:git reset HEAD~1 This will return your repository to its state before
the git add commands that staged the files. Your changes will be in
your working directory. HEAD~1 refers to the commit below the current
tip of the branch.If you want to uncommit N commits, but keep the code changes in your
working directory:git reset HEAD~N If you want to get rid of your latest commit, and do
not want to keep the code changes, you can do a “hard” reset.git reset –hard HEAD~1 Likewise, if you want to discard the last N
commits, and do not want to keep the code changes:git reset –hard HEAD~N
2.删除远端commit
先退回到正确的local commit然后
git push –force
git 解决ahead behind分叉以及删除远端commit相关推荐
- git解决冲突 删除本地_解决冲突
人生不如意之事十之八九,合并分支往往也不是一帆风顺的. 准备新的feature1分支,继续我们的新分支开发: $ git switch -c feature1 Switched to a new br ...
- git 删除远端分支
1.在项目路径内右键选择git bash here,打开命令行窗口 2.运行git branch -a 命令查看全部远端分支 3.运行git push origin --delete 分支名命令,删除 ...
- Git回滚版本并push到远端master
办法一. [Gitlab]GIT回滚master分支到指定tag版本 并提交远程仓库 1 查看分支 git branch 2 切换到master分支 git checkout master 3 查看标 ...
- git解决冲突(超详细图文版及常用命令)
操作流程 pull add commit push 或 add commit pull push 详细过程----------------------------------------------- ...
- 如何使用Git解决“错误:错误索引 - 致命:索引文件损坏”
在git init ,我添加并提交了一些文件,进行了一些更改,添加并提交. 设置git守护程序(在WinXP上的Cygwin下运行)并克隆一次存储库. 现在,我在克隆的存储库中收到此错误: $ git ...
- git解决冲突 merge 不提示_Merge,Rebase,Cherry-Pick 了解一下
代码合并在日常开发中是较为常见的场景,采用合适的合并方式,可以起到事半功倍的效果.对应在 Git 中合并的方式主要有三个,Merge,Rebase,Cherry-Pick. 开始部分会首先介绍一下这三 ...
- git 解决冲突(6)
人生不如意之事十之八九,合并分支往往也不是一帆风顺的. 准备新的feature1 分支,继续我们的新分支开发: $ git checkout -b feature1 Switched to a new ...
- 新建tag 查看本地Tag 查看远端Tag 基于远端Tag新建分支 删除远端Tag 等操作
1.查看本地tag git tag 2. 查看远端tag git ls-remote --tags origin 4. 新建tag git tag -a newTag -m "xxx这里是该 ...
- git branch -D 大写的D 删除分支
今天删除本地分支 git branch -d XX 提示: the branch XXX is not fully merged 原因:XXX分支有没有合并到当前分支的内容 解决方法:使用大写的D ...
最新文章
- expdp导出表结构_超强技术案例!86万张表迁移的优化历程
- 【转】C++11 并发指南五(std::condition_variable 详解)
- C++位操作确定一个数是否为2的幂的算法实现(附完整源码)
- JavaScript大杂烩4 - 理解JavaScript对象的继承机制
- firebug for IE6+, Firefox, Opera, Safari and Chrome
- Vue2.0 之 自带浏览器里无法打开(兼容IE处理) - 解决方案 命令
- 几种方法帮你更有效率的记笔记
- C语言三种常见的输出格式
- JS 获得FileUpload1 的完整路径
- 计算机流程图代表判断的是什么意思,算法流程图符号含义有哪些?用奇偶数判断算法流程图理解...
- linux df -h显示空间信息不正确
- c/c++ 实现三角函数(不使用库函数) sin/cos/tan/cot
- Windows7不停弹出计算机界面,拨号连接自动弹出,教您如何解决电脑总是自动弹出...
- 什么打印软件比较好用?可以打印资料的网上打印平台
- 【JS】Number to digit tiers
- 华为机试真题 C++ 实现【处理器问题】【2022.11 Q4 新题】
- 工程建设项目管理信息系统
- 活动星投票网络文明公益广告网络评选微信的投票方式线上免费投票
- 分享UG塑胶模具设计的分模方法,一起学起来
- Qt6.2 LTS实战 | 女生美声为你报时,为你读诗