title: How can I push certain files to origin/master in Git?
body: <p>I am little bit new to Git. I would like to push some files to my Git origin (remote).</p>
  
  <p>What I did:</p>
  
  <p>I had my master, and I created a branch to do some job. After that I merged my branch to my master. During my work, a lot of binary files and project files were changed/added locally. I would like <em>only</em> to add <em>.java</em> files which changed to remote server.</p>
  
  <p>(I believe that I experimented with <em>commits</em> when I worked on my branch, just to check how it work.)</p>
  
  <p>My master is <em>up to date</em> with my origin (that is what I get when I do <code>git pull</code>. Also I did <code>git fetch  origin</code>.
  I always received (when I ran <code>git status</code>):</p>
  
  <pre><code>On branch master Your branch is ahead of origin/master by 12 commits.
    (use "git push" to publish your local commits)
  
  nothing to commit, working directory clean`
  </code></pre>
  
  <p>I tried to <em>add, commit</em> those files, but running <code>git status</code> wasn't changed. I tried to do <em>add, commit</em> on the new branch:</p>
  
  <pre><code>On branch NewBranch nothing to commit, working directory clean
  </code></pre>
  
  <p>I tried to reset Head. I didn't find a solution for my problem in the Git tutorial or on Stack Overflow.</p>
  
  <p>Of course I can push all files to remote origin, but I don't think it's a good solution.</p>
  
  <p>Some duplicate questions that I found:
  <a href="https://stackoverflow.com/questions/13479763/how-to-push-a-single-file-in-a-subdirectory-to-github-not-master">How to push a single file</a>, <a href="https://stackoverflow.com/questions/15937405/git-how-to-push-changes-made-to-only-certain-files">how to push changes made to only certain files?</a>, and <a href="https://stackoverflow.com/questions/7239333/how-to-commit-only-some-files">How to commit only some files?</a>.</p>