Windows git:在重新基址期间自动与联合策略合并
我想在执行Windows git:在重新基址期间自动与联合策略合并,windows,git,merge,rebase,gitattributes,Windows,Git,Merge,Rebase,Gitattributes,我想在执行git-rebase时,通过保留所有添加的行,自动合并.csproj文件: mkdir example cd example git init echo "*.csproj text merge=union" > .gitattributes echo "hello" > sample.csproj git add -A git commit -m "initial commit" git branch test git checkout test echo "from
git-rebase
时,通过保留所有添加的行,自动合并.csproj文件:
mkdir example
cd example
git init
echo "*.csproj text merge=union" > .gitattributes
echo "hello" > sample.csproj
git add -A
git commit -m "initial commit"
git branch test
git checkout test
echo "from test" >> sample.csproj
git add -A
git commit -m "from test"
git checkout master
echo "from master" >> sample.csproj
git add -A
git commit -m "from master"
git rebase test
有两个问题。首先,此操作失败,并出现二进制警告:
Falling back to patching base and 3-way merge...
warning: Cannot merge binary files: sample.csproj (HEAD vs. from master)
Auto-merging sample.csproj
CONFLICT (content): Merge conflict in sample.csproj
Failed to merge in the changes.
第二个问题是在我的另一个repo上,it correct确定文件是文本(不确定为什么),但合并仍然失败
Falling back to patching base and 3-way merge...
Auto-merging Source/App/TRPS.Build/TRPS.Build.csproj
CONFLICT (content): Merge conflict in Source/App/TRPS.Build/TRPS.Build.csproj
Failed to merge in the changes.
在我将
md
更改为mkdir
之后,第一个脚本(Ubuntu,Git 1.9.3)适合我。你在Windows上吗?您的CRLF设置是什么?