You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/content/guides/git/05-undo-commits.md
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ cms: [drupal, wordpress]
12
12
audience: [development]
13
13
product: [--]
14
14
integration: [--]
15
+
reviewed: "2025-01-23"
15
16
---
16
17
17
18
Git makes it easy to reverse commits pushed to the Pantheon Dev environment.
@@ -174,6 +175,10 @@ You can revert a past commit that has been pushed to your Test or Live environme
174
175
175
176
You can reset your Dev environment history to match the current state of your Live environment using [Terminus](/terminus). The method in this section is destructive and should be used with caution. It does not clone the Live environment's database or files down to Dev. However, it does reset the Dev environment's codebase.
We've adjusted the following steps for [Integrated Composer sites](/guides/integrated-composer), so that you reset history to the **second** to last commit hash on the Live environment, rather than the first - to avoid resetting dev's history to a build artifact.
198
+
199
+
</Alert>
200
+
201
+
1. Identify the **second** most recent commit deployed to Live.
202
+
203
+
1. Run the command below to overwrite the history on Dev's codebase to reflect Live (replace `<site>` with your site's name):
This happens if you **reset** Dev to an earlier commit, rather than using **revert**. You must make a commit on Dev to re-sync the environments. This will also get the commit history between the environments to match. The commit you use can be trivial, such as a space or extra line added to a comment within a file. You'll see the commit available for deployment on Test, and then on Live after you commit the change.
Copy file name to clipboardExpand all lines: source/content/terminus/03-examples.md
+69Lines changed: 69 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ cms: [drupal, wordpress]
14
14
audience: [development]
15
15
product: [terminus]
16
16
integration: [--]
17
+
reviewed: "2025-01-23"
17
18
---
18
19
19
20
This section provides information on how to apply updates, deploy code, switch upstreams, and install Drush and WP-CLI with Terminus, as well as information on command structure and automatic site and environment detection.
@@ -281,6 +282,11 @@ There are a few scenarios where it may be useful to reset your Dev environment (
281
282
282
283
- The Dev environment has been seriously corrupted and you would like to cleanly reset it to Live.
We've adjusted the following script for [Integrated Composer sites](/guides/integrated-composer), so that you reset history to the **second** to last commit hash on the Live environment, rather than the most recent - to avoid resetting history to a build artifact.
348
+
349
+
</Alert>
350
+
351
+
1. Clone the site's codebase to your local machine if you have not done so already (replace `awesome-site` with your site name):
#Force push to Pantheon to rewrite history on Dev and reset codebase to Live
380
+
git push origin master -f
381
+
382
+
#Clone database and files from Live into Dev
383
+
echo"Importing database and files from Live into Dev...";
384
+
terminus env:clone-content $SITE.live dev
385
+
386
+
#Open the Dev environment on the Site Dashboard
387
+
terminus dashboard:view $SITE.dev
388
+
```
389
+
390
+
1. Execute the script from the command line within the root directory of your site's codebase:
391
+
392
+
```bash{promptUser: user}
393
+
sh /PATH/TO/SCRIPT/reset-dev-to-live.sh
394
+
```
395
+
396
+
The Site Dashboard will open when the reset procedure completes.
397
+
398
+
</Tab>
399
+
400
+
</TabList>
401
+
333
402
## Switch Upstreams
334
403
335
404
Every site has an assigned upstream to deliver [one-click updates](/core-updates) in the Pantheon Site Dashboard. Terminus can be used to manage this site-level configuration. There are a few scenarios where it may be useful to change a site's upstream:
0 commit comments