Not working for you? See <a href="/node/1065850">Troubleshooting Git clone</a>. Once it works, you need the <a href="/project/git_deploy">Git deploy</a> module. See <a href="/node/1314752">Versioned dependencies and Git</a> for an explanation.
@@ -183,25 +180,26 @@ The headings below are not sequential. What you choose to do depends on where yo
<h3>Checking your repository status</h3>
To see what you will commit by running <code>git commit</code> and what you could commit by running <code>git add</code> before running <code>git commit</code>.
<div class="codeblock">
<code>git status</code><br />
<code>git status</code>
</div>
<h3>Switching to a different branch</h3>
When you clone the repository you have access to all the branches and tags. The first command shows your choices. The second command makes the switch. See <a href="/node/1066342">branching and tagging</a> for details.
<div class="codeblock">
<code>git branch -a</code><br />
<code>git checkout [branchname]</code><br />
<code>git branch -a</code><br>
<code>git checkout [branchname]</code>
</div>
<h3>Committing all changes locally</h3>
After making changes, add and commit them. Do not begin commit messages with the # symbol. See <a href="/node/52287">Commit messages</a> for details.
<div class="codeblock">
<code>git add -A</code><br />
<code>git add -A</code><br>
<code>git commit -m "Issue #[issue number] by [comma-separated usernames]: [Short summary of the change]."</code>
</div>
<h3>Pushing your code back to the repository on Drupal.org</h3>
<div class="codeblock">
<code>git push -u origin HEAD</code>
</div>
<h2>Patching</h2>
<p>Contributing changes with patches is being replaced with <a href="/docs/develop/git/using-git-to-contribute-to-drupal/creating-issue-forks-and-merge-requests">issue forks and merge requests</a>.</p>
<h3>Getting ready to create or apply patches</h3>
@@ -213,54 +211,86 @@ If you have not already cloned the repository, follow the directions above for s
<h3>Creating a patch</h3>
For most improvements, use the following command after making your changes:
For more complex improvements that require adding/removing files, work over the course of multiple days including Git commits, or collaboration with others, see the <a href="/node/1054616">Advanced patch workflow</a>.
<h3>Applying a patch </h3>
Download the patch to your working directory. Apply the patch with the following command:
<div class="codeblock">
<code>git apply -v [patchname.patch]</code><br />
<code>git apply -v [patchname.patch]</code>
</div>
To avoid accidentally including the patch file in future commits, remove it:
See the <a href="/node/1015226">naming conventions</a> for a complete description of how to name branches and tags so you can create releases.
<h2>Creating releases</h2>
See the <a href="!naming-conventions-url">naming conventions</a> for a complete description of how to name branches and tags so you can create releases.
<h3>Branch for a dev release</h3>
This creates and checks out a new branch in one command, then pushes it to Drupal.org
<div class="codeblock">
<code>git checkout -b @newbranch</code><br />
<code>git push -u origin @newbranch</code><br />
<code>git checkout -b @newbranch</code><br>
<code>git push -u origin @newbranch</code>
</div>
<h3>Tag for a stable release</h3>
<div class="codeblock"><code>git tag [tag name]
git push origin tag [tag name]</code></div>
<p>Once you’ve pushed the properly-formed tag or branch, see <a href="/node/1068944">Creating a project release</a> for directions to actually create the release node.</p>',$defaults)];
}
else{
// Is not maintainer.
$content[]=['#markup'=>t('<h2>One-Time Only</h2>
<p>Once you’ve pushed the properly-formed tag or branch, see <a href="!creating-release-url">Creating a project release</a> for directions to actually create the release node.</p>',$defaults+[
<h3>Setting up this repository for the first time</h3>
<p>See <a href="!git-authentication-url">Git Authentication for Drupal.org Projects</a> for information about setting up SSH keys and other ways to authenticate.</p>
<p>When you’ve completed these steps, create a (dev) release and then <a href="">refresh this page</a> for further direction.</p>
<p><strong>Note:</strong> You have created a local repository. You will not need to complete the One-Time clone on the next page unless you delete your local repository or set up on a different machine. Then, you’ll need to perform the One-time setup, as will co-maintainers.</p>
<h2>Creating releases</h2>
See the <a href="!naming-conventions-url">naming conventions</a> for a complete description of how to name branches and tags so you can create releases.
<h3>Branch for a dev release</h3>
This creates and checks out a new branch in one command, then pushes it to Drupal.org
<div class="codeblock">
<code>git push -u origin @newbranch</code>
</div>
<p>Once you’ve pushed the properly-formed branch, see <a href="!creating-release-url">Creating a project release</a> for directions to actually create the release node.</p>',$defaults+[
Not working for you? See <a href="/node/1065850">Troubleshooting Git clone</a>. Once it works, you need the <a href="/project/git_deploy">Git deploy</a> module. See <a href="/node/1314752">Versioned dependencies and Git</a> for an explanation.
<h2>Routinely</h2>
@@ -268,13 +298,13 @@ The headings below are not sequential. What you choose to do depends on where yo
<h3>Checking your repository status</h3>
To see what you will commit by running <code>git commit</code> and what you could commit by running <code>git add</code> before running <code>git commit</code>.
<div class="codeblock">
<code>git status</code><br />
<code>git status</code>
</div>
<h3>Switching to a different branch</h3>
When you clone the repository you have access to all the branches and tags. The first command shows your choices. The second command makes the switch. See <a href="/node/1066342">branching and tagging</a> for details.
<div class="codeblock">
<code>git branch -a</code><br />
<code>git checkout [branchname]</code><br />
<code>git branch -a</code><br>
<code>git checkout [branchname]</code>
</div>
<h2>Patching</h2>
<p>Contributing changes with patches is being replaced with <a href="/docs/develop/git/using-git-to-contribute-to-drupal/creating-issue-forks-and-merge-requests">issue forks and merge requests</a>.</p>
@@ -287,57 +317,48 @@ If you have not already cloned the repository, follow the directions above for s
<h3>Creating a patch</h3>
For most improvements, use the following command after making your changes:
For more complex improvements that require adding/removing files, work over the course of multiple days including Git commits, or collaboration with others, see the <a href="/node/1054616">Advanced patch workflow</a>.
<h3>Applying a patch</h3>
Download the patch to your working directory. Apply the patch with the following command:
<div class="codeblock">
<code>git apply -v [patchname.patch]</code><br />
<code>git apply -v [patchname.patch]</code>
</div>
To avoid accidentally including the patch file in future commits, remove it:
<h3>Setting up this repository for the first time</h3>
<p>See <a href="/node/1027094">Git Authentication for Drupal.org Projects</a> for information about setting up SSH keys and other ways to authenticate.</p>
<p>When you’ve completed these steps, <a href="">refresh this page</a> for further direction.</p>
<code>git reset --hard</code>
</div>',$defaults);
<p><strong>Note:</strong> You have created a local repository. You will not need to complete the One-Time clone on the next page unless you delete your local repository or set up on a different machine. Then, you’ll need to perform the One-time setup, as will co-maintainers.</p>',$defaults)];
<p>No code is available for %title. <a href="/project/issues/@uri?categories=All">File an issue</a> or contact a maintainer if you have questions.</p>',$defaults)];