I\'m trying to have two branches with binary files in git - one \"development\" and one \"stable\". The development branch can have several changes of these files before I w
The top voted answer effectively diffs the stable and the development branches and applies all changes missing in the stable as one commit. There is an alternative way to do this:
$ git checkout stable
$ git diff stable development | git apply --index -
$ git commit
Before you commit, you can review the staged files. If you want to abort the process after you applied the diff, you can just use basic commands to remove changes from index and working directory.
$ git reset --hard
You can repeat the process any number of times, since you are effectively just diff-ing the tips of both the branches each time you need to merge.
Note that there is assumption here that applies to the other answer as well: there are no commits in the stable branch other than the ones that came from the development branch. If the same line were changed independently in both branches, unlike a regular merge, this approach would not give you a conflict. Instead, it would just override the changes in the stable branch with the ones in development.
If you are concerned about this, each time you commit on stable, you can put the merged development commit hash range in the commit message. That way, you have some record, if you ever need to backtrack.