title: Best way to collaborate on working on 1 analysis file without losing changes?
body: <p>my team and I have to do work on 1 analysis file. To avoid losing changes, we have agreed that only 1 person is allowed to apply changes at a time. To keep track of the changes we decided to use Git. So we put the analysis file in a Git repository. That way we can use the commit messages to refer to specific work being done in the past (i.e. if we need to revert the file to a previous state).</p>
  
  <p>Having said that, the above way of work is not ideal. Normally in a version control project, we should be able to collaborate and we should be able to resolve "Merge conflicts" if another person has changed the same line of a file and decided what change we would like to pick "theirs" or "ours". So I decided to experiment with the analysis file and unzip it to its consisting files:</p>
  
  <p><a href="https://i.stack.imgur.com/0ll29.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0ll29.png" alt="enter image description here"></a></p>
  
  <p>Most of the files (except the image and the txt file) are XML files which are run through a minification algorithm (to take less space on disk) so there is no formatting - everything is on 1 line. For example, this is how the "7.11-AnalysisDocument.xml" looks like (note the length of the file):</p>
  
  <p><a href="https://i.stack.imgur.com/2rAl4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2rAl4.png" alt="enter image description here"></a></p>
  
  <p>In the current state of all of these XML files, it's impossible to use a version control system like Git as they track changes on individual lines of code and in that case, all of the XML files have only 1 line of code. So even if we put the unzipped version of our analysis file into Git it will be pointless as it git will show that the whole line has changed when somebody applies a change to the document. </p>
  
  <p>So I thought maybe we should create a script and attach it to the pre-commit <a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks" rel="nofollow noreferrer">Git hook</a> (git allows us to execute a script before we execute the commit action) that will:</p>
  
  <ol>
  <li>unzip the document </li>
  <li>format all of its XML files in there so that everything is formatted on the appropriate line (see below)</li>
  <li>optionaly zip it again into a the file with extension "dxp"</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/Ed2KZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ed2KZ.png" alt="enter image description here"></a></p>
  
  <p>However, that sounds like overcomplicating the initial problem, there has to be an easier way to do that. Can anybody give me any pointers on how a team can collaborate on working with 1 analysis file without losing changes? </p>