Skip to content

Commit 2a070fd

Browse files
authored
Improve git step documentation (#1744)
* Better introduction sentence * Use more modern branch name in example * Link to the documentation of the checkout step
1 parent ecbc940 commit 2a070fd

File tree

1 file changed

+10
-10
lines changed
  • src/main/resources/jenkins/plugins/git/GitStep

1 file changed

+10
-10
lines changed

src/main/resources/jenkins/plugins/git/GitStep/help.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<div>
22
<p>
3-
Git step. It performs a clone from the specified repository.
3+
The <code>git</code> step performs a clone from the specified repository into a Pipeline workspace.
44
</p>
55
<p>
66
Use the <a href="https://www.jenkins.io/redirect/pipeline-snippet-generator">Pipeline Syntax Snippet Generator</a> to generate a sample pipeline script for the git step.
7-
More advanced checkout operations require the <code>checkout</code> step rather than the <code>git</code> step.
7+
More advanced checkout operations require the <a href="https://www.jenkins.io/doc/pipeline/steps/params/scmgit/"><code>checkout</code> step</a> rather than the <code>git</code> step.
88
Examples of the <code>git</code> step include:
99
<ul>
1010
<li><a href="#git-step-with-defaults">Git step with defaults</a></li>
@@ -17,7 +17,7 @@
1717
</p>
1818

1919
<p>
20-
The <code>git</code> step is a simplified shorthand for a subset of the more powerful <code>checkout</code> step:
20+
The <code>git</code> step is a simplified shorthand for a subset of the more powerful <a href="https://www.jenkins.io/doc/pipeline/steps/params/scmgit/"><code>checkout</code> step</a>:
2121
<pre>
2222
checkout scmGit(branches: [[name: 'main']],
2323
userRemoteConfigs: [[url: 'https://git-server/user/repository.git']])
@@ -27,14 +27,14 @@
2727
<hr>
2828

2929
<p>
30-
<strong>NOTE:</strong> The <code>checkout</code> step is the <strong>preferred SCM checkout method</strong>.
30+
<strong>NOTE:</strong> The <a href="https://www.jenkins.io/doc/pipeline/steps/params/scmgit/"><code>checkout</code> step</a> is the <strong>preferred SCM checkout method</strong>.
3131
It provides significantly more functionality than the <code>git</code> step.
3232
</p>
3333
<p>Use the <a href="https://www.jenkins.io/redirect/pipeline-snippet-generator">Pipeline Syntax Snippet Generator</a> to generate a sample pipeline script for the checkout step.
3434
</p>
3535
<p>
36-
The <code>checkout</code> step can be used in many cases where the <code>git</code> step cannot be used.
37-
Refer to the <a href="https://plugins.jenkins.io/git/#plugin-content-extensions">git plugin documentation</a> for detailed descriptions of options available to the checkout step.
36+
The <a href="https://www.jenkins.io/doc/pipeline/steps/params/scmgit/"><code>checkout</code> step</a> can be used in many cases where the <code>git</code> step cannot be used.
37+
Refer to the <a href="https://plugins.jenkins.io/git/#plugin-content-extensions">git plugin documentation</a> for detailed descriptions of options available to the <a href="https://www.jenkins.io/doc/pipeline/steps/params/scmgit/"><code>checkout</code> step</a>.
3838
For example, the <code>git</code> step does <strong>not</strong> support:
3939
<ul>
4040
<li>SHA-1 checkout</li>
@@ -59,13 +59,13 @@
5959
Checkout from the git plugin source repository using https protocol, no credentials, and the master branch.
6060
</p><p>The <a href="https://www.jenkins.io/redirect/pipeline-snippet-generator">Pipeline Syntax Snippet Generator</a> generates this example:
6161
<pre>
62-
git 'https://github.com/jenkinsci/git-plugin'
62+
git 'https://github.com/jenkinsci/git-plugin.git'
6363
</pre>
6464
</p>
6565

6666
<strong><a id="git-step-with-https-and-branch">Example: Git step with https and a specific branch</a></strong>
6767
<p>
68-
Checkout from the Jenkins source repository using https protocol, no credentials, and a specific branch (stable-2.204).
68+
Checkout from the Jenkins source repository using https protocol, no credentials, and a specific branch (stable-2.492).
6969
Note that this must be a local branch name like 'master' or 'develop'.
7070
</p>
7171
<p>
@@ -76,11 +76,11 @@
7676
<li>Tag names are <strong>not supported</strong> as the branch argument</li>
7777
</ul>
7878
<p>
79-
Remote branch names, SHA-1 hashes, and tag names <strong>are supported</strong> by the general purpose <code>checkout</code> step.
79+
Remote branch names, SHA-1 hashes, and tag names <strong>are supported</strong> by the general purpose <a href="https://www.jenkins.io/doc/pipeline/steps/params/scmgit/"><code>checkout</code> step</a>.
8080
</p>
8181
<p>The <a href="https://www.jenkins.io/redirect/pipeline-snippet-generator">Pipeline Syntax Snippet Generator</a> generates this example:
8282
<pre>
83-
git branch: 'stable-2.204',
83+
git branch: 'stable-2.492',
8484
url: 'https://github.com/jenkinsci/jenkins.git'
8585
</pre>
8686
</p>

0 commit comments

Comments
 (0)