title: GitHub: how to fork public repo to enterprise, edit enterprise version but still update with public fork
body: <p>This is a follow up to the question <a href="https://stackoverflow.com/questions/29952033/is-it-possible-to-fork-a-public-github-repo-into-an-enterprise-repository/54600542">Is it possible to fork a public GitHub repo into an enterprise repository?</a></p>
  
  <p>I want to fork the public project <code>github.com/foo.git</code> and work on it on my enterprise server, under the name <code>github.enterprise.com/bar.git</code>. However, I want to keep them linked so I can pull any changes on the master. In other words, I am going to create some new codes and edits in my enterprise <code>bar.git</code>, but whenever the authors of <code>foo.git</code> update their master repo, I want to pull those changes.  So I followed the following steps.</p>
  
  <ol>
  <li>Create an empty repository on <code>github.enterprise.com/bar.git</code></li>
  <li>Fork <code>github.com/foo.git</code> on my public GitHub account <code>github.com/MyPublic/foo.git</code></li>
  <li>Rename my public repo as to <code>bar.git</code> so it's <code>github.com/MyPublic/bar.git</code></li>
  <li><p>Create a bare clone of my new fork on my computer  </p>
  
  <p><code>git clone --bare https://github.com/MyPlublic/bar.git</code></p></li>
  <li><p>Change directories into the bare clones folder: </p>
  
  <p><code>cd bar.git/</code></p></li>
  <li><p>Push the repository with the --mirror flag to my enterprise GitHub </p>
  
  <p><code>git push --mirror https://github.enterprise.com/bar.git
   git remote set-url --push origin https://github.enterprise.com/bar.git</code></p></li>
  </ol>
  
  <p>Now I have the <code>bar.git/</code> directory on my computer, which is <code>BARE:master</code> and not an editable version of the repo. I have <code>bar.git</code> repos on my personal public GitHub.com account and on my Enterprise server. The next things I need to do are (1) clone the enterprise repo onto my computer and edit it; (2)  commit and push those changes to the enterprise repo; and (3) I also want to pull changes from the master <code>foo.git</code> repo when they happen. </p>
  
  <p>I'm assuming I just do a standard clone, commit, and push for (1) and (2), i.e. </p>
  
  <pre><code> git clone GitHub.enterprise.com/bar.git
   git commit
   git push
  </code></pre>
  
  <p>Is it actually possible to do #3? I'm thinking that in my computer's <code>bar.git/</code> directory, I execute </p>
  
  <pre><code> git fetch -p origin
   git push --mirror
  </code></pre>
  
  <p>and then in the <code>bar/</code> directory, I execute a standard <code>git pull</code>?</p>