Drupal Enterprise 7,8: Push Changes to Your Repository Using Git Shell

The following instructions are for websites using either the default UMN Drupal Enterprise 7 (DE7) configuration or the default UMN Drupal Enterprise 8 (DE8) configuration.

After you have installed UMN Drupal locally to work with the UMN Git repository, you can push code to your repository by following these steps.

Pushing code to your UMN Git repository

  1. Open Git Shell.
  2. If you have not cloned your site's repository to your local computer, run the command git clone [clone URL] [name of directory].
  3. Run the command cd to navigate to your repository's main folder.
    • If you came to this article from installing UMN Drupal locally, this will be the acquia-drupal/sites/default folder.
    • If you have set this up in your Github folder, this will be what you have named your local folder.
  4. Run the command git checkout to change branches to the one that should be updated.
  5. Run the command git pull to copy any changes from the github repository to your local repository.
  6. Add or update the needed files in the local repository using your computer's explorer windows.
  7. Back in the Git Shell, run the command git status to show which files have changed, for example [develop +0 ~1 -0]. The numbers and branch may be different. This indicates that files have been changed / added / deleted.
  8. Run the command git add . (You need to type the period too; this will add all the modified files to the commit.)
    • The numbers on your command line, for example +0 ~1 -0, should now be a different color.
  9. Run the command git commit €“m "[message about your commit]".
    • A message will display explaining which files were committed and what type of changes were made (i.e., add / change / delete.)
  10. Run the command git push to copy all the changed files from the local repository to your github repository.
    • After all steps have been completed, your git shell will look similar to this:
      Console showing completed steps
  11. Go to your repository on http://github.umn.edu and verify that the changes are there. Your page should show the time of the latest commit.
    Screenshot of github.umn.edu repository showing changes have been pushed
  12. Deploy the new code to your site:
    1. Dev or Stage environment:
      1. Log in to Drupal Management with your UMN Internet ID and password (http://drupalmanagement.umn.edu/saml_login)
      2. Navigate to the site you are working on
      3. Click "Deploy" on the environment that you are working on.
      4. Confirm the deployment. 
    2. Production environment: Submit Drupal Support Request form requesting that your changes be deployed.

 

TDX ID
3816