Is it possible to setup git merge for automatic resolving? (git rerere)

I have 2 laptops with one plaintext file, which has to be synced – it is used as a database for a 3rd party software. Customer wants to sync the content of that file on a daily manner.

First idea was to make a script which would upload file to Dropbox, but in case of confilct (both users remove line A and first user add line B instead, second user add line C instead) Dropbox creates a separate file.
EDIT: was going to mention, but forgot to say: in case of conflict, both lines B and C should replace line A – “take both” strategy.

  • pg_dump not been killed inside script with kill command
  • How to translate git command line to tortoiseproc?
  • Git says “Warning: Permanently added to the list of known hosts”
  • How do I 'svn add' all unversioned files to SVN?
  • Bower install Libraries Issues
  • Way to show merging status in command line in git
  • Second idea is to put file to repository, sounds easy, but i’m not sure how to setup auto resolving, because i don’t want merge tool GUI to appear during the process.

  • Git branching and switching back to master is ahead?
  • Convert Git Repo to Darcs
  • Git CRLF changes showing up in git status
  • Https certificate errors for GitHub using git on Windows 7
  • How to git ignore ipython notebook checkpoints anywhere in repository
  • How to remove files that are listed in the .gitignore but still on the repository?
  • 2 Solutions collect form web for “Is it possible to setup git merge for automatic resolving? (git rerere)”

    You have the git rerere command for your help.

    This is exactly for this command is for.

    git rerere

    Recorded Reused Resolution

    # enabled the option to record the 
    git config --global rerere.enabled true
    

    By the way, if you prefer rerere to auto-stage files it solved (I do), you can ask it to: you just need to tweak your configuration like so:

    git config --global rerere.autoupdate true
    

    enter image description here

    If you want all conflicts resolved with changes from both sides being included, add the following to your .gitattributes file:

    * merge=union
    

    This will make git do what you want.

    Git Baby is a git and github fan, let's start git clone.