We provide a variety of utilities to help resolve particular problems or perform specific tasks. Below, you'll find a description of each utility that's available for you to use.

These commands can be executed from anywhere on the VM after signing in as an SSH admin user. You can find more information about enabling SSH access here.

General

Git

Hypervisor Tools

Import and Export

Search

Support

User Management


ghe-check-disk-usage

This utility checks the disk for large files or files that have been deleted but still have open file handles. This should be run when you're trying to free up space on the root partition.

Usage:
ghe-check-disk-usage

ghe-chef-info

This utility gets information on the current state chef is in.

Tip: Typically, you will only execute this if you've contacted support and they've asked you to do so.

Usage:
ghe-chef-info

ghe-cleanup-caches

This utility cleans up a variety of caches that might potentially take up extra disk space on the root volume. If you find your root volume disk space usage increasing notably over time it would be a good idea to run this utility to see if it helps reduce overall usage.

Usage:
ghe-cleanup-caches

ghe-cleanup-chef

This utility cleans up files that can potentially cause the chef automation which performs upgrades and settings changes to be in a bad state.

Tip: Typically, you will only execute this if you've contacted support and they've asked you to do so.

Usage:
ghe-cleanup-chef

ghe-cleanup-repos

This utility fixes repositories in various bad states (e.g., won't delete through the web UI). Running it without any arguments will not make any changes and will only check to see if you have any affected repositories. Running it again with the -f flag will cause it to take action.

Usage:
ghe-cleanup-repos

ghe-cleanup-settings

This utility wipes all existing Management Console settings.

Tip: Typically, you will only execute this if you've contacted support and they've asked you to do so.

Usage:
ghe-cleanup-settings

ghe-dbconsole

This utility opens a MySQL database session on your GitHub Enterprise appliance. Do not use it to modify your database unless you are asked to do so by our Enterprise support team.

Usage:
ghe-dbconsole

ghe-diagnostics

This utility performs a variety of checks and gathers information about your installation that you can send to support to help diagnose problems you're having. Currently, it does roughly the same thing browsing to

http(s)://hostname/setup/diagnostics

but may have additional improvements added to it over time that aren't available in the web UI.

Usage:
ghe-diagnostics

ghe-diskusage

This utility allows you to use the system du utility to calculate disk usage for directories the admin user doesn't normally have access to. It takes all provided arguments and passes them straight through to du.

Usage:
ghe-diskusage -h --max-depth=1 /data

ghe-es-reindex

This utility queues up search indexing jobs for all users, repositories, and code in your installation. This should be used if most of your search data appears to be out-of-date. If you only want to reindex a particular user or repository you can use the available buttons in the Admin Tools dashboard or via the Search Indexing API.

Usage:
ghe-es-reindex

ghe-es-reset

Warning: This utility is destructive and should only be used when told to do so by support.

When run, it deletes all existing search indexes along with all audit data. If you have Log Forwarding setup, then all of the audit data is also stored outside of the VM so you'll still have it for archival purposes, but it will no longer be available from inside the GitHub application. After deleting all indexes, it will kick off background jobs to reindex everything for search purposes.

Usage:
ghe-es-reset

ghe-es-status

This utility checks the current status of ElasticSearch for any known issues. If it finds an issue, it will recommend an appropriate action or ask you to contact support. You should use this if searches aren't working as expected.

Usage:
ghe-es-status

ghe-export

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility exports all MySQL, Redis, and repository data into a single tarball (.tgz) and then streams its contents. Keep in mind that this utility caches all of its data locally on the VM before streaming it, whereas individual export utilities do not. As such, we typically recommended using the individual export utilities rather than this one.

Usage:
ssh admin@enterprise-server -- 'ghe-export' > ghe-backup.tgz

ghe-export-authorized-keys

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility exports all installed SSH authorized keys for the admin SSH user. The data is streamed as JSON data.

Usage:
ssh admin@enterprise-server -- 'ghe-export-authorized-keys' > ghe-backup-authorized-keys.json

ghe-export-es-indices

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility exports all ElasticSearch indexes, which includes indexed repositories, code, and users. Most importantly, this includes audit log data which is not reproducible. The data is streamed as a tar file.

Usage:
ssh admin@enterprise-server -- 'ghe-export-es-indices' > ghe-backup-es-indices.tar

ghe-export-mysql

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility exports all MySQL data, which includes users, commit comments, pull requests, issues, etc. The data is streamed as plain text.

Usage:
ssh admin@enterprise-server -- 'ghe-export-mysql' | gzip > ghe-backup-mysql.sql.gz

ghe-export-pages

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility exports all generated Pages for repositories and users on the installation. The data is streamed as a tar file.

Usage:
ssh admin@enterprise-server -- 'ghe-export-pages' > ghe-backup-pages.tar

ghe-export-redis

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility exports all Redis data, which includes a variety of cached data counts and other settings required by the application. The data is streamed as a standard redis dump file (.rdb).

Usage:
ssh admin@enterprise-server -- 'ghe-export-redis' > ghe-backup-redis.rdb

ghe-export-repositories

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility exports all repository data, which includes all git repository data. The data is streamed as a tar file (.tar).

Usage:
ssh admin@enterprise-server -- 'ghe-export-repositories' > ghe-backup-repositories.tar

ghe-export-ssh-host-keys

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility exports the SSH host keys for an installation. These keys will prevent SSH fingerprint mismatch warnings when moving to a new appliance. The data is streamed as a tar file.

Usage:
ssh admin@enterprise-server -- 'ghe-export-ssh-host-keys' > ghe-backup-ssh-host-keys.tar

ghe-export-graphs

This utility exports data written to RRD databases by collectd as a gzip'd tarball of XML files. It is not meant to be included in your regular backups, but lets you export the data for further analysis without the need to download a support bundle. If you open a support ticket, Enterprise support may ask for this data to help in troubleshooting the issue.

Usage:
ssh admin@enterprise-server -- 'ghe-export-graphs' && scp admin@enterprise-server:~/graphs.tgz .

ghe-git-compatibility-fix

This utility fixes repositories exhibiting zero-padded mode corruption. Running it against a repository will rewrite the entire git history, requiring everyone with a local copy to reclone the affected repositories.

Tip: Typically, you will only execute this if you've contacted support and they've asked you to do so.

Usage:
ghe-git-compatibility-fix

ghe-git-gc

This utility runs a manual git garbage collection (git gc) on a repository. This helps reduce the size of a large repositories. It compresses file revisions and removes unreachable objects. GitHub Enterprise automatically runs a git gc once per day for every repository when it's pushed to. As such, any repositories that grow significantly after the initial automatic git gc but are not pushed to subsequently may benefit from a manual git gc. If you have a large repository, running this command may help reduce its overall size. Typically, this is not necessary though.

Usage:
ghe-git-gc github-username/github-reponame

ghe-grow-root

This utility increases the size of the root logical volume by creating a new partition and then merging it into the root volume. You normally shouldn't use this utility more than once because that could reduce system performance.

Note that you must specify a partition that doesn't existghe-grow-root will create it for you. If you haven't previously run this command, you'll want to use the /dev/sda device.

Usage:
ghe-grow-root -d /dev/sda

ghe-import

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility imports a backup taken with ghe-export. Please note that this will overwrite any existing data and should typically only be used to restore to a fresh Enterprise installation.

Usage:
ssh admin@enterprise-server -- 'ghe-import' < ghe-backup.tgz

ghe-import-authorized-keys

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility imports a backup taken with ghe-export-authorized-keys. Please note that if a key already exists, an error will be raised but all other keys will import as expected. Typically, this should only be used to restore to a fresh Enterprise installation.

Usage:
ssh admin@enterprise-server -- 'ghe-import-authorized-keys' < ghe-backup-authorized-keys.json

ghe-import-es-indices

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility imports a backup taken with ghe-export-es-indices. If any existing indexes exist, they'll be moved to a backup directory under /home/admin. Typically, this should only be used to restore to a fresh Enterprise installation.

Usage:
ssh admin@enterprise-server -- 'ghe-import-es-indices' < ghe-backup-es-indices.tar

ghe-import-mysql

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility imports a backup taken with ghe-export-mysql. Please note that all existing MySQL data will be dropped when importing a backup. Typically, this should only be used to restore to a fresh Enterprise installation.

Usage:
gzip -dc ghe-backup-mysql.sql.gz | ssh admin@enterprise-server -- 'ghe-import-mysql'

ghe-import-pages

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility imports a backup taken with ghe-export-pages. Please note that any existing Pages data on the new appliance will be overwritten. Typically, this should only be used to restore to a fresh Enterprise installation.

Usage:
ssh admin@enterprise-server -- 'ghe-import-pages' < ghe-backup-pages.tar

ghe-import-redis

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility imports a backup taken with ghe-export-redis. Please note that all existing Redis data will be dropped when importing a backup. Typically, this should only be used to restore to a fresh Enterprise installation.

Usage:
ssh admin@enterprise-server -- 'ghe-import-redis' < ghe-backup-redis.rdb

ghe-import-repositories

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility imports a backup taken with ghe-export-repositories. Please note that any existing repository data will be overwritten. Typically, this should only be used to restore to a fresh Enterprise installation.

Usage:
ssh admin@enterprise-server -- 'ghe-import-repositories' < ghe-backup-repositories.tar

ghe-import-ssh-host-keys

We highly recommend that you use the GitHub Enterprise Backup Utilities instead of running this script directly.

This utility imports a backup taken with ghe-export-ssh-host-keys. Typically, this should only be used to restore to a fresh Enterprise installation.

Usage:
ssh admin@enterprise-server -- 'ghe-import-ssh-host-keys' < ghe-backup-ssh-host-keys.tar

ghe-install-virtualbox-tools

This utility uninstalls the existing open-vm-tools module and installs VirtualBox Guest Additions. You can get more instructions on how to do that here.

Usage:
ghe-install-virtualbox-tools

ghe-install-vmware-tools

This utility uninstalls the existing open-vm-tools module and installs VMware Tools. You can get more instructions on how to do that here.

Usage:
ghe-install-vmware-tools

ghe-logs-tail

This utility lets you tail log all relevant log files from your installation. You can pass options in to limit the logs to specific sets. Use the -h flag for additional options.

Usage:
ghe-logs-tail

ghe-maintenance

This utility allows you to control the state of the installation's maintenance mode. It's designed to be used primarily by the Management Console behind-the-scenes, but it can be used directly.

Usage:
ghe-maintenance -h

ghe-org-owner-promote

New in 11.10.340!

This utility adds site admin accounts to the Owners team of every organization on an installation. By default, this will add all site admin accounts to each organization's Owners team, but you can also use the -u flag if you only want to specify a particular site admin account.

Note that this utility only works on site admin accounts; you can promote an ordinary user account to a site admin with ghe-user-promote.

Usage:
ghe-org-owner-promote

ghe-recovery-upgrade

This utility performs a manual upgrade from the CLI on the appliance. Under normal circumstances, you will perform remote upgrades using the Management Console API.

Tip: Typically, you will only execute this if you've contacted support and they've asked you to do so.

Usage:
ghe-recovery-upgrade -f /path/to/package.ghp

ghe-repo-repair

This utility repairs repository permissions if they happen to be incorrect. Running it without options will detect if any permissions need to be adjusted. Using the -f flag will actually fix those permissions.

Usage:
ghe-repo-repair

ghe-resque-info

This utility prints out information regarding background jobs currently being processed. It directly relates to the job count visible in the admin stats bar at the top of all pages when logged in as an admin. If you're seeing these number grow, event feeds failing to be updated, and service hooks not triggering as expected, this may shed some light on the problem.

Usage:
ghe-resque-info

ghe-ssl-ca-certificate-install

This utility allows you to install a custom root CA certificate on your GitHub Enterprise server. The certificate must be in PEM format. Furthermore, if your certificate provider includes multiple CA certificates in a single file, you must separate them into individual files that you then pass to ghe-ssl-ca-certificate-install one at a time.

Run this utility when your Enterprise instance is unable to connect to another server because the latter is using a self-signed SSL certificate or an SSL certificate for which it doesn't provide the necessary CA bundle. One way to confirm this is to run openssl s_client -connect host:port -verify 0 from your Enterprise instance. If the remote server's SSL certificate can be verified, your SSL-Session should have a return code of 0, as shown below.

SSL-Session:
    Protocol  : TLSv1
    Cipher    : AES128-SHA
    Session-ID: C794EBCC3CBC10F747C9AFC029C03C1048FC99CFC34D13D7444E0F267C58DF4C
    Session-ID-ctx:
    Master-Key: 02A7C47CFD6EEC87D3C710E9DD87390E04EF82DDD7514AE03127D5DC1945FC0CAEFB5395791AEA598667EFA61B9EA8C5
    Key-Arg   : None
    Start Time: 1394581597
    Timeout   : 300 (sec)
    Verify return code: 0 (ok)

If, on the other hand, the remote server's SSL certificate can not be verified, your SSL-Session should have a nonzero return code:

SSL-Session:
    Protocol  : TLSv1
    Cipher    : AES128-SHA
    Session-ID: 82CB288051A6DB66094C50A69CF1292AEE7E54C6B01B659B98AB336F8C33863E
    Session-ID-ctx:
    Master-Key: 01B025B2F764043A27919A8D1355AAECD8844FF0831B1D664042334790574A6F4025BAB085D4ED71D71AAB3091B849E5
    Key-Arg   : None
    Start Time: 1394581782
    Timeout   : 300 (sec)
    Verify return code: 27 (certificate not trusted)

Use the -h option for more usage information.

Usage:
ghe-ssl-ca-certificate-install -c /path/to/certificate

ghe-support-bundle

This utility creates a support bundle tarball containing important logs from the VM. By default, it will create the tarball in /tmp, but you can pass in a flag to have it cat the tarball to STDOUT for easy streaming over SSH. This is helpful in the case where the web UI is unresponsive or downloading a support bundle from /setup/support doesn't work for some other reason.

Usage:
ssh admin@enterprise-server -- 'ghe-support-bundle -o' > support-bundle.tgz

ghe-time-sync

This utility performs a large time correction if your clock remains incorrect after configuring your NTP and timezone settings.

Usage:
ghe-time-sync

ghe-user-csv

This utility dumps out a list of all the users in the installation into CSV format. The CSV file includes the email address, which type of user they are (e.g., admin, user), how many repositories they have, how many SSH keys, how many organization memberships, last logged IP address, etc. Use the -h flag for more options.

Usage:
ghe-user-csv -o > users.csv

ghe-user-promote

This utility promotes the specified user account to a site administrator.

Usage:
ghe-user-promote some-user-name

ghe-user-demote

This utility demotes the specified user from admin status to that of a regular user. We recommend using the web UI to perform this action, but provide this utility in case the ghe-user-promote utility is run in error and you need to demote a user again from the CLI.

Usage:
ghe-user-demote some-user-name

ghe-user-suspend

This utility suspends the specified user, preventing them from logging in, pushing, or pulling from your repositories.

Usage:
ghe-user-suspend some-user-name

ghe-user-unsuspend

This utility unsuspends the specified user, granting them access to login, push, and pull from your repositories.

Usage:
ghe-user-unsuspend some-user-name

ghe-vm-reboot

This utility allows you to reboot your appliance. Typically, you do this from the hypervisor, but many companies are setup in such a way that the person administering the appliance doesn't actually have access to the hypervisor. This results in having to request some other team perform the reboot for you, which happens on their timeframe, not the administrator's. This utility allows you to reboot your appliance at will without having to do that.

Usage:
ghe-vm-reboot -n