gpt4 book ai didi

android - 如何 merge 分支并忽略flutter生成的二进制文件中的冲突?

转载 作者:IT王子 更新时间:2023-10-29 07:20:17 25 4
gpt4 key购买 nike

我正在尝试 merge 与我合作的开发人员提交的存储库的一个分支。与主分支有一些冲突。

$ git merge remotes/origin/master
warning: Cannot merge binary files: android/.gradle/buildOutputCleanup/outputFiles.bin (HEAD vs. remotes/origin/master)
warning: Cannot merge binary files: android/.gradle/buildOutputCleanup/buildOutputCleanup.lock (HEAD vs. remotes/origin/master)
warning: Cannot merge binary files: android/.gradle/4.4/taskHistory/taskHistory.lock (HEAD vs. remotes/origin/master)
warning: Cannot merge binary files: android/.gradle/4.4/taskHistory/taskHistory.bin (HEAD vs. remotes/origin/master)
warning: Cannot merge binary files: android/.gradle/4.4/javaCompile/taskJars.bin (HEAD vs. remotes/origin/master)
warning: Cannot merge binary files: android/.gradle/4.4/javaCompile/taskHistory.bin (HEAD vs. remotes/origin/master)
warning: Cannot merge binary files: android/.gradle/4.4/javaCompile/javaCompile.lock (HEAD vs. remotes/origin/master)
warning: Cannot merge binary files: android/.gradle/4.4/javaCompile/jarAnalysis.bin (HEAD vs. remotes/origin/master)
warning: Cannot merge binary files: android/.gradle/4.4/javaCompile/classAnalysis.bin (HEAD vs. remotes/origin/master)
warning: Cannot merge binary files: android/.gradle/4.4/fileHashes/resourceHashesCache.bin (HEAD vs. remotes/origin/master)
warning: Cannot merge binary files: android/.gradle/4.4/fileHashes/fileHashes.lock (HEAD vs. remotes/origin/master)
warning: Cannot merge binary files: android/.gradle/4.4/fileHashes/fileHashes.bin (HEAD vs. remotes/origin/master)
Auto-merging pubspec.yaml
Auto-merging lib/pages/qaView.dart
Auto-merging lib/firebase/firebaseManager.dart
Removing android/app/google-services.json
Auto-merging android/app/build.gradle
Auto-merging android/.gradle/buildOutputCleanup/outputFiles.bin
CONFLICT (content): Merge conflict in android/.gradle/buildOutputCleanup/outputFiles.bin
Auto-merging android/.gradle/buildOutputCleanup/buildOutputCleanup.lock
CONFLICT (content): Merge conflict in android/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Auto-merging android/.gradle/4.4/taskHistory/taskHistory.lock
CONFLICT (content): Merge conflict in android/.gradle/4.4/taskHistory/taskHistory.lock
Auto-merging android/.gradle/4.4/taskHistory/taskHistory.bin
CONFLICT (content): Merge conflict in android/.gradle/4.4/taskHistory/taskHistory.bin
Auto-merging android/.gradle/4.4/javaCompile/taskJars.bin
CONFLICT (content): Merge conflict in android/.gradle/4.4/javaCompile/taskJars.bin
Auto-merging android/.gradle/4.4/javaCompile/taskHistory.bin
CONFLICT (content): Merge conflict in android/.gradle/4.4/javaCompile/taskHistory.bin
Auto-merging android/.gradle/4.4/javaCompile/javaCompile.lock
CONFLICT (content): Merge conflict in android/.gradle/4.4/javaCompile/javaCompile.lock
Auto-merging android/.gradle/4.4/javaCompile/jarAnalysis.bin
CONFLICT (content): Merge conflict in android/.gradle/4.4/javaCompile/jarAnalysis.bin
Auto-merging android/.gradle/4.4/javaCompile/classAnalysis.bin
CONFLICT (content): Merge conflict in android/.gradle/4.4/javaCompile/classAnalysis.bin
Auto-merging android/.gradle/4.4/fileHashes/resourceHashesCache.bin
CONFLICT (content): Merge conflict in android/.gradle/4.4/fileHashes/resourceHashesCache.bin
Auto-merging android/.gradle/4.4/fileHashes/fileHashes.lock
CONFLICT (content): Merge conflict in android/.gradle/4.4/fileHashes/fileHashes.lock
Auto-merging android/.gradle/4.4/fileHashes/fileHashes.bin
CONFLICT (content): Merge conflict in android/.gradle/4.4/fileHashes/fileHashes.bin
Auto-merging .packages
CONFLICT (content): Merge conflict in .packages
Auto-merging .flutter-plugins
CONFLICT (content): Merge conflict in .flutter-plugins
Automatic merge failed; fix conflicts and then commit the result.

但我知道无法 merge 的冲突都是生成的文件,我不应该担心它们,bin,lock 文件。它们不是配置或代码文件。

有没有办法让 git 忽略所有,而不是遍历每个目录并指定 *.bin, *.lock ??

最佳答案

如果它们是从源生成的文件,则有两件事:

  • 首先,从 merge 源中生成它们(在提交之前)并且应该处理它们的“冲突”
  • 但第二点也是更重要的一点:从项目源代码生成的文件根本不应该被跟踪

关于android - 如何 merge 分支并忽略flutter生成的二进制文件中的冲突?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56047542/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com