Github:Enterprise is used to interact with code for custom theming and site building.
The information below assumes:
The below instructions can be adapted for the GUI GitHub client (Windows or Mac), or similar GUI Git client.
The following information is provided without support and is meant for Drupal developers only.
If you haven’t already, you must identify yourself to Git.
git config --global user.name 'Your Name' git config --global user.email you@somedomain.com
If there are other users who need to access a repo, they will need to be added to your organization. The user must first log in to Github:Enterprise using their Yale NetID to create an account.
You must fork the main Drupal 7 repository to begin working with code.
After your Jenkins job has been set up, code pushes to your fork will automatically trigger a deployment of the updated code to your dev site. It takes about 15 minutes for code to be deployed. You can verify the Jenkins job is working with following steps:
Github:Enterprise allows for one forked instance from its interface. If you are an organization and need to fork the main Drupal 7 repo multiple times for different sites you are working on, you will need to follow these steps.
$ git clone git@git.yale.edu:drupal/d7.git Cloning into 'd7'... remote: Counting objects: 130784, done. remote: Compressing objects: 100% (31752/31752), done. remote: Total 130784 (delta 92178), reused 130771 (delta 92166) Receiving objects: 100% (130784/130784), 53.73 MiB | 9.46 MiB/s, done. Resolving deltas: 100% (92178/92178), done. Checking out files: 100% (9051/9051), done.
$ cd d7 $ git remote rename origin upstream $ git remote add origin git@git.yale.edu:ORGNAME/dev.sitename.yale.edu.git
$ git push -u origin master
From your repo, you have access to modify themes and modules available to your site.
Please ONLY modify files within:
Any other changes, such as changes to Drupal core, will NOT be merged upstream.
Over time, changes will be made upstream to the drupal/d7 repo, such as Drupal core updates as well as module updates and additions. You will want to pull these changes in occasionally to keep your fork up to date.
To create automatically create a comparison between your repository and the drupal/d7 repository, visit this URL, replacing {ORG} with your organization name: https://git.yale.edu/drupal/d7/compare/{ORG}:master…drupal:master
Next, click the ‘Create pull request’ button. This will create a new pull request to merge the changes from the drupal/d7 repo into your repo. Fill the title in with ‘Merge changes from upstream drupal/d7 repo’ and click ‘Send pull request’. This will open a pull request, and you can click the green ‘Merge pull request’ button to merge the changes into your repository.
This process is best done at the command line. It may also be possible to merge from an upstream remote inside a GUI Git client.
When a repo is cloned, it has a default remote called origin that points to your fork on GitHub, not the original repo it was forked from. To keep track of the original repo, you need to add another remote named upstream. If you are working on a fork created from the instructions in the previous section, “Forking multiple times”, you can skip to “Fetch and merge upstream changes” below.
cd myrepository git remote add upstream https://git.yale.edu/drupal/d7.git
Fetch changes from your newly configured remote called upstream, and merge them, accepting all upstream changes.
git fetch upstream git merge upstream/master -Xtheirs -m"Merge remote-tracking branch 'upstream/master'"
Push changes to your remote repository.
git push origin master