git 写错了commit应该如何修改,merge、rebase的区别&功能

个人记录日志
##修改上一个commit的记录比较简单
git commit -amend
##修改多个多个commit使用这个
git rebase -i
可能会用到的命令
git rebase --abort 终止
git rebase --continue 结束
git rebase --skip 跳过

git merge --squash copy某一个commit的修改记录然后重新提交现在的分支上面
git merge e/–edit 类似于squash

–no-edit?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Git merge and rebase are both ways to integrate changes from one branch into another branch in Git version control system. Git merge is a process where Git combines the changes of two or more branches into a new commit on the current branch. This creates a merge commit that has two or more parent commits, representing the history of the merged branches. Merge is a simple and straightforward operation that preserves the entire history of both branches. Git rebase, on the other hand, is a process where Git moves the changes of one branch to the tip of another branch, effectively re-writing the history of the branch being rebased. This creates a linear history, as if the changes from the rebased branch were always part of the receiving branch. Rebase is a more advanced operation that requires more care and attention, as it can rewrite history and potentially cause conflicts. The decision to use merge or rebase depends on the specific situation and the desired outcome. Merge is typically used for combining long-lived feature branches or merging changes from upstream repositories. Rebase is typically used for keeping a clean and linear history, or when working on short-lived branches that are not shared with others. In summary, Git merge and rebase are two ways to integrate changes between branches in Git. Merge creates a merge commit that preserves the entire history of both branches, while rebase rewrites the history of the rebased branch to be part of the receiving branch. The choice between merge and rebase depends on the specific situation and desired outcome.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值