Resetting a repository completely erases your code and all repository history. If you need this data, make a backup now before proceeding.
When you reset your repository, you may also want to empty your databases. Before you reset the repository, you can accomplish this by using the following Drush command:
drush @site.env sql-drop
Clearing the repository
Use the following steps to clear your current repository. This procedure requires that you're signed into the Acquia Could UI and can execute command line tools on your local server.
- Deploy the master branch on all environments in the Acquia Cloud Dashboard. For more information on how to manage code on Acquia Cloud see Code workflows with Acquia Cloud
- Clone the repo locally for safety. On your local server, run the following command:
-
git clone --mirror [repo_address]
where
[repo_address]
is the URL of your code repository. - Create a new, empty repository on your local computer. Navigate to a new directory on your local computer, and then run the following commands from the command line:
% mkdir reset % cd reset % git init
- In the reset directory, add a directory named
docroot
, which contains an empty file.% mkdir docroot % touch docroot/README.txt
- Send the empty repository to the remote server by adding and committing the changes to the folder.
% git add . % git commit -m "Initial commit"
- Add the remote origin Git repository:
git remote add origin [repo_address]
where
[repo_address]
is the URL of your code repository. - Push the changes to the remote repository.
git push --mirror --force
The remote repository should now be cleared of its code.