about git-merge "Binary files differ"

=>run "git merge master"

than:

warning: Cannot merge binary files: 1 (HEAD vs. master)
Auto-merging 1.c
CONFLICT (content): Merge conflict in 1.c
Auto-merging 1
CONFLICT (content): Merge conflict in 1
Automatic merge failed; fix conflicts and then commit the result.

=>run "git diff"

than:

diff --cc 1
index 6d0cda6,d34cdef..0000000
Binary files differ
diff --cc 1.c
index 18b4f17,7a293d3..0000000
--- a/1.c
+++ b/1.c
@@@ -2,8 -2,7 +2,12 @@@
  #include<stdlib.h>
  int main(int argc, char** argv)
  {
++<<<<<<< HEAD
 +      printf("tom:\n");
 +      printf("jane:\n");
++=======
+       printf("Alice:\n");
++>>>>>>> master
        if(argc < 2)
        {
                printf("pls input more than 2 args\n");

=>run "./1 3"

than:

tom:
jane:
hello world
hello world
hello world

====================================

so:

binary file will not insert the differents as text file,

if you want to change it, you should copy another 

one and replace. run "git add filename" &

 "git commit".








  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
`git branch --ff-only merge` 不是一个有效的 Git 命令。请注意,`--ff-only` 和 `merge` 是独立的选项和指令。 `git branch --ff-only` 是一个用于检查当前分支是否可以进行快进合并(fast-forward merge)的命令。快进合并是指将一个分支的提交历史直接应用到另一个分支上,而不会创建新的合并提交。如果使用 `git branch --ff-only` 检查当前分支时,结果为成功,则说明当前分支可以进行快进合并。 另一方面,`merge` 是一个用于将一个分支的更改合并到当前分支的命令。可以使用 `git merge <branch>` 来执行合并操作,其中 `<branch>` 是要合并的分支名称。 因此,如果你想将一个分支(例如 "merge" 分支)的更改合并到当前分支,并且只在快进合并可行时才进行合并,可以按照以下步骤操作: 1. 首先,确保你在要合并更改的目标分支上。你可以使用 `git checkout <target_branch>` 命令切换到目标分支。 2. 然后,运行 `git branch --ff-only` 命令来检查是否可以进行快进合并。 3. 如果 `git branch --ff-only` 命令返回成功,即当前分支可以进行快进合并,则运行 `git merge merge` 命令来将 "merge" 分支的更改合并到当前分支。 需要注意的是,合并操作可能会导致合并提交的生成,特别是当两个分支之间存在分叉点时。只有在可以进行快进合并的情况下,才会执行无合并提交的快进合并。否则,将创建一个新的合并提交来合并两个分支的更改。 总结起来,`git branch --ff-only` 是用于检查当前分支是否可以进行快进合并的命令,而 `git merge <branch>` 是用于将一个分支的更改合并到当前分支的命令。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值