How to create new git branch with jenkins shell
<p>I would like to reach the following:</p>

<blockquote>
  <ol>
  <li>In some jenkins job, create a new branch from dev-branch</li>
  <li>do some changes on the new created branch new-branch</li>
  <li>push the new created branch to git repo</li>
  </ol>
</blockquote>

<p>I did the following steps in Jenkins:</p>

<blockquote>
  <ol>
  <li>I have configured my git repo in the section "Source Code Management" and also the branches to build is my dev-branch.</li>
  <li>In Section Post Steps: Execute shell --> Command I have added the following:</li>
  </ol>
</blockquote>

<pre><code>git checkout -b new-branch
... do some changes
git add .
git commit -a -m "I have added some changes"
git push -u origin new-branch
</code></pre>

<p>Now when I run this job I get the following in the console output:</p>

<pre><code>+ git checkout -b R1.10.0.0_SII
Switched to a new branch 'new-branch'
+ git add .
+ git commit -a -m 'I have added some changes'
[new-branch 0dc7cf8] I have added some changes
+ git push -u origin new-branch
fatal: 'origin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Build step 'Execute shell' marked build as failure
</code></pre>

<p>How to create a new branch with jenkins, do some changes and push the new created branch correctly?</p>