Mac problems when doing git merge master with branch that has bower
<p>Quite new to git and mac.</p>

<p>But I'm using the <code>Git Plus</code> in Atom to handle all my version control via git. But I'm having a lot problems if I add components/libs via bower to my ionic project.</p>

<p>Working on branch <code>quick_fix</code> and adding a <code>angular-cookies</code> (ionic stores it in a folder called <code>lib</code>). Update the code and do some commits.</p>

<p>Had some problems doing it in Atom after using <code>bower</code>, so try the terminal. So I do the following in the Terminal:</p>

<pre><code>git checkout master

warning: unable to unlink www/lib/angular-cookies/.bower.json: Permission denied
warning: unable to unlink www/lib/angular-cookies/LICENSE.md: Permission denied
warning: unable to unlink www/lib/angular-cookies/README.md: Permission denied
warning: unable to unlink www/lib/angular-cookies/angular-cookies.js: Permission denied
warning: unable to unlink www/lib/angular-cookies/angular-cookies.min.js: Permission denied
warning: unable to unlink www/lib/angular-cookies/angular-cookies.min.js.map: Permission denied
warning: unable to unlink www/lib/angular-cookies/bower.json: Permission denied
warning: unable to unlink www/lib/angular-cookies/index.js: Permission denied
warning: unable to unlink www/lib/angular-cookies/package.json: Permission denied
</code></pre>

<p>So these files are now still in the folder... even though that I'm back to the master code that doesn't have the hot fixes...</p>

<pre><code>git status

On branch master
Untracked files:
  (use "git add &lt;file&gt;..." to include in what will be committed)

    www/lib/angular-cookies/
</code></pre>

<p>If I try to do a merge I get the following</p>

<pre><code>sudo git merge quick_fix

Updating 034f577..8b74fa5
error: The following untracked working tree files would be overwritten by merge:
    www/lib/angular-cookies/.bower.json
    www/lib/angular-cookies/LICENSE.md
    www/lib/angular-cookies/README.md
    www/lib/angular-cookies/angular-cookies.js
    www/lib/angular-cookies/angular-cookies.min.js
    www/lib/angular-cookies/angular-cookies.min.js.map
    www/lib/angular-cookies/bower.json
    www/lib/angular-cookies/index.js
    www/lib/angular-cookies/package.json
Please move or remove them before you can merge.
Aborting
</code></pre>

<p>How do I do a merge?</p>

<p>I think that the problem has to do with doing a checkout to master without doing <code>sudo</code>. So I'm not giving it permission to delete the folders.. Is there any way I can give permanent sudo permissions to delete files in this working directory - so the Atom editor can do a checkout to master without keeping the added component..</p>

<p>Problem is that I can't checkout <code>quick_fix</code> because it gives me the same error and aborts.</p>