title: How to push commit to git repository without adding Remote?
body: <p>I have some repository, like <a href="https://nickname@bitbucket.org/nickname/repo-name.git" rel="nofollow noreferrer"><a href="https://nickname@bitbucket.org/nickname/repo-name.git" rel="nofollow noreferrer">https://nickname@bitbucket.org/nickname/repo-name.git</a></a>. I need to push some data to this repo, using Java. </p>
  
  <p>So, basically I want to do these steps:</p>
  
  <ol>
  <li>Create temporary directory (<strong>tmp_path == /temp/tmp/dir</strong>)</li>
  <li>cd tmp_path</li>
  <li>git init</li>
  <li>git remote add origin <a href="https://nickname@bitbucket.org/nickname/repo-name.git" rel="nofollow noreferrer">https://nickname@bitbucket.org/nickname/repo-name.git</a></li>
  <li>create temp file with needed data (<strong>filanme == tmpfile.txt</strong>)</li>
  <li>git add filename</li>
  <li>git commit --message="adding tmp file"</li>
  <li>git push origin tmp-branch</li>
  </ol>
  
  <p>But there is one problem. I <a href="https://stackoverflow.com/questions/4884681/how-to-use-cd-command-using-java-runtime">cannot</a> make "<strong>cd</strong>" from Java. So I need another solution.</p>
  
  <p>Is there any way to push some data to repository without local git folder? </p>