開発ブランチでAndroidアプリを開発していました。私は自分の変更をマスタにマージしたいと思っています。答えはhereで提案されている方法を使って、実際にマスターする前に潜在的な問題を処理するためにdevブランチにマスターをマージします。Androidアプリのapp/build/intermediateディレクトリに多数のマージ競合があります
をGitHubにまで私の変更をプッシュする - 私の変更git push origin devBranch
をコミットする - すべての私の現在の変更
git commit -m"My commit message
を追加する -
git add .
:私のdevの枝にしながら、だから私は、次のコマンドを実行しました
git merge master
- 私のmasterブランチをdevブランチにマージする
これは私が私が決してなかったEEN前に:私の問題は、彼らが私に触れたことがない中間ファイルにしているので、私はこれらの競合を解決する方法がわからないということです
warning: Cannot merge binary files: app/build/intermediates/res/resources-debug.ap_ (HEAD vs. master)
Auto-merging app/build/intermediates/res/resources-debug.ap_
CONFLICT (content): Merge conflict in app/build/intermediates/res/resources-debug.ap_
Auto-merging app/build/intermediates/incremental/mergeDebugResources/merger.xml
CONFLICT (content): Merge conflict in app/build/intermediates/incremental/mergeDebugResources/merger.xml
Auto-merging app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml
CONFLICT (add/add): Merge conflict in app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml
Auto-merging app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v17/values-v17.xml
CONFLICT (add/add): Merge conflict in app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v17/values-v17.xml
Auto-merging app/build/intermediates/incremental/mergeDebugResources/compile-file-map.properties
CONFLICT (content): Merge conflict in app/build/intermediates/incremental/mergeDebugResources/compile-file-map.properties
Auto-merging app/build/intermediates/incremental/mergeDebugAndroidTestResources/compile-file-map.properties
CONFLICT (content): Merge conflict in app/build/intermediates/incremental/mergeDebugAndroidTestResources/compile-file-map.properties
Auto-merging app/build/intermediates/blame/res/debug/single/layout.json
CONFLICT (content): Merge conflict in app/build/intermediates/blame/res/debug/single/layout.json
Auto-merging app/build/intermediates/blame/res/debug/single/drawable.json
CONFLICT (content): Merge conflict in app/build/intermediates/blame/res/debug/single/drawable.json
Auto-merging app/build/intermediates/blame/res/debug/single/drawable-xhdpi-v4.json
CONFLICT (content): Merge conflict in app/build/intermediates/blame/res/debug/single/drawable-xhdpi-v4.json
Auto-merging app/build/intermediates/blame/res/debug/single/drawable-hdpi-v4.json
CONFLICT (content): Merge conflict in app/build/intermediates/blame/res/debug/single/drawable-hdpi-v4.json
Auto-merging app/build/intermediates/blame/res/debug/multi/values.json
CONFLICT (content): Merge conflict in app/build/intermediates/blame/res/debug/multi/values.json
Automatic merge failed; fix conflicts and then commit the result.
、私はこれがすべて生成されたコードであると仮定しています。多分私はgit add .
を実行することで自分自身を困惑させているかもしれませんが、それは私がいつもやったやり方です。私が変更した個々のファイルを追加することは現実的ではないようです(変更されたファイルも追加したいと思います。 ?)。
私がマージしている方法のためにこれらの競合が発生していますか?もし私が私のmasterブランチに切り替えて、devブランチをmasterにマージすれば同じ問題が起こるでしょうか?私はこれを試すことを恐れているが、それは私が以前に変更をマージしていた方法であり、このような問題は一度もなかった。
これは悪臭があります。あなたの中間ビルドのターゲットディレクトリは、理想的にはGitには見えないようにすべきです。この修正は '.git'フォルダ内にファイルをビルドしないことです。 –
'.gitignore'ファイルに' app/build/'行を追加します。ここで素晴らしい例が見つかります:https://github.com/github/gitignore/blob/master/Android.gitignore。それを追加した後は、 'git rm'ビルドフォルダだけにすることができます。ビルド製品は、ほとんどソース管理にはなりません。 – jjm