title: How to push an existing projects in new Github repository?
body: <p>I am studying git now and I have a problem in pushing my existing files in the new repository I created in Github.</p>
  
  <p>Here's what i did:</p>
  
  <ol>
  <li>I perform this inside my project <code>- git init</code></li>
  <li>I added the files in the local repository <code>- git add .</code></li>
  <li>I commit <code>- git commit -m "This is the base code for the project"</code></li>
  <li>Then I copy the github repository URL in my Github page <code>https://github.com/myname/my_projects.git</code></li>
  <li>Then I point out the repository <code>- git remote add origin https://github.com/myname/my_projects.git</code></li>
  <li>Then I push my files <code>- git push origin master</code></li>
  </ol>
  
  <p>Then after doing the push I have this error:</p>
  
  <pre><code>λ git push origin master
  Username for 'https://github.com': myname
  Password for 'https://myname@github.com':
  To https://github.com/myname/my_projects.git
   ! [rejected]        master -&gt; master (fetch first)
  error: failed to push some refs to 'https://github.com/myname/my_projects.git'
  hint: Updates were rejected because the remote contains work that you do
  hint: not have locally. This is usually caused by another repository pushing
  hint: to the same ref. You may want to first integrate the remote changes
  hint: (e.g., 'git pull ...') before pushing again.
  hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  </code></pre>
  
  <p>Can you help me with this?</p>