git merge --参数 branch_name
git merge参数
1、--squash  合并的分支,以一个提交被合入

git merge方法

 

2、--no-ff  保存合并的分支的记录,被合并分支有记录

git merge方法

 

使用git reset --hard HEAD^  回退到上一个版本,此种方法可以直接回退到主分支合并之前;
git reset --hard HEAD^^回退到上上个版本,

git reset --hard HEAD~100 回退到上100个提交

 

git reset --hard <commit_id> 命令修改 HEAD 的指向的 commit_id 来达到版本回退的目的

3、--ff  

效果等同fast-forward ,如果分支可以通过移动头指针来完成合并,就是fast-forward

即默认启用fast-forward方式进行合并,不会显示 feature,只保留单条分支记录;

git merge方法

 

 

报错:

  • git gc --prune=now  to clean up your local repo
  •  
    If that doesn't work, you can also try to clean the remote with  git fetch --prune 
  •  
    If that still doesn't work you can try rm .git/logs/refs/remotes/origin/xyz 

 

相关文章:

  • 2021-06-10
  • 2021-06-27
猜你喜欢
  • 2021-10-26
  • 2021-11-06
  • 2022-03-01
  • 2021-07-24
  • 2021-07-26
  • 2021-06-09
相关资源
相似解决方案