GitHub at Georgia Tech
GitHub at Georgia TechGeorgia Tech staff, students, and faculty can now use a Georgia Tech instance of GitHub, a version/revision control system. This service is available thanks to the College of Engineering's brilliant proof of concept with GitHub Enterprise, and the ensuing excited buy-in from the Office of Information Technology.
What is GitHub and Why Should I Use Revision Control?
GitHub is a proprietary hosted extension of the open-source Git version/revision control system commonly used for open-source software projects. It is very useful for multi-developer projects, as it allows coordinating and tracking code changes and the orderly acceptance and integration of those changes into the master project. Version control also makes it much easier to revert back to an earlier version of the software if it is discovered that accepted changes have caused unexpected problems.
Or, to put it short, it'll save your bacon. Figuratively, not literally.
Support Policy
OIT does not offer technical support or training for Git or GitHub usage. If you want to learn how to use git, see below for many educational resources.
Accessing Georgia Tech GitHub Enterprise
Just go to https://github.gatech.edu and log in with your GT Account Username and password.
GitHub User Software
You can access repositories in GitHub using git from the command line of most Unix based operating systems (see GitHub's KB), but you can also use a variety of GUI (graphical user interface) applications, such as:
- For beginners, GitHub's Desktop (for Mac OS X or Windows).
- For something that works on both Windows and Mac, try SourceTree.
- There are also lots more graphical clients to use with git.
Drupal List
We have a Drupal community group in GitHub that allows users to share and collaborate on projects. Please add collaborative projects to the GT Drupal group on GitHub at Georgia Tech.
Learn to Use git with GitHub Resources
You can learn how to use git (and GitHub) with these tools from GitHub Enterprise, such as:
- Guides: Tutorials, tips, and workflows to help you and your team learn about GitHub.
- Reference Sheets: Quick reference guides and manuals for GitHub
Learn to Use git with General Internet Resources
The internet has lots of other great places to teach you about git. Here are a few:
- Lynda.com - GitHub for Web Designers
- Lynda.com - Fundamentals of Software Revision Control
- Learn Git Branching - A good interactive visual guide to Git's concept of version control.
Local GitHub Guides and Resources
Forking a GitHub Repository and Using Pull Requests
Forking a GitHub Repository and Using Pull RequestsForking creates a copy of a repository which you can work on. You can then submit a pull request to have your changes reviewed and integrated with the master repo. This is the order of operations:
FORK > SYNC > BRANCH > COMMIT > PUSH > PULL REQUEST
Download a PDF version of this guide.
Forking a Repository
Reference: https://help.github.com/articles/fork-a-repo/
In Github, navigate to the repository to be forked and select “Fork” on the upper right. Select your own user name when prompted. This creates a copy of the repository for you on Github.
Now you should see your fork. Copy the URL using this button:
Open Terminal and type:
git clone https://github.gatech.edu/ORG_NAME/Repo-Name
Here (after clone) you should paste the URL you copied at the beginning of this step. This creates a local copy of your clone on your machine under your current directory.
Connect your Fork to the Master
Next, sync your fork with the master to ensure that any changes going on with the master will be reflected in your local fork/clone.
Navigate in Github to the original repository. Copy the URL as shown:
-
Open Terminal and change directories to the fork you cloned.
cd
(enter)ls
(look for your cloned fork/repository name)cd Fork_Name
git remote -v
git remote add upstream https://github.gatech.edu/ORG_NAME/Repo-Name
-
Alternately, you can both add and fetch (sync with) your master by using this instead:
git remote add -f upstream https://github.gatech.edu/ORG_NAME/Repo-Name
-
Verify your upstream repository is syncing.
git remote -v
Syncing Your Fork
Reference: https://help.github.com/articles/syncing-a-fork/
You probably want your fork to mirror the latest changes being made to the main repository. If you used “git remote add -f upstream” in the previous step, this is already done. If you used “git remote add upstream” and now you need to fetch upstream to sync your fork, you can use this method.
-
In Terminal, change to the directory of your local clone and fetch upstream to sync with the original master repository.
cd Fork_Name
git fetch upstream -
Check out your fork’s local master branch.
git checkout master
git merge upstream/master
Branch Your Fork
Now Branch your issue locally.
In Terminal:
git checkout -b name_of_your_new_branch
Committing Changes to Your Fork
-
Change your files as needed.
-
In Terminal,
git status
This will confirm that git is watching your modifications.
-
Add the files to staging (substitute your file name or names)
git add path/file_name
-
Then commit
git commit -m “First commit”
You will get feedback saying how many files were changed and how.
Note for newbies: A branch may contain many commits. Name your branch to reflect what you’re working on and name commits to reflect more specific changes.
Pushing Your Changes to GitHub
In Terminal,
git push origin name_of_your_new_branch
Now you should see your branch show up in Github.
Making a Pull Request
Reference: https://help.github.com/articles/using-pull-requests/
-
Select your branch in Github. Select “New pull request”
You can enter details about the changes you are suggesting. You can also select a branch to send the request to, if it’s not the master branch.
-
When you’re ready, select “Create pull request” at the bottom.
After you send a pull request, any commit that’s pushed to your branch will be automatically added to your pull request, which is useful if you’re making additional changes.
GitHub Submodule Management
GitHub Submodule ManagementSubmodules allow you to keep a Git repository as a subdirectory of another Git repository. This lets you clone another repository into your project and keep your commits separate.
To define the submodules for the various GT Theme components, add the following sections to the .gitmodules file for each repository:
[submodule "gt_tools"]
path = web/modules/contrib/gt_tools
url = https://github.gatech.edu/ICWebTeam/gt_tools-8.x.git
update = checkout
branch = master
ignore = dirty
shallow = TRUE
[submodule "gt_theme"]
path = web/themes/contrib/gt_theme
url = https://github.gatech.edu/ICWebTeam/gt_theme-8.x.git
update = checkout
branch = master
ignore = dirty
shallow = TRUE
[submodule "hg_reader"]
path = web/modules/contrib/hg_reader
url = https://github.gatech.edu/ICWebTeam/hg_reader-8.x.git
update = checkout
branch = master
ignore = dirty
shallow = TRUE
[submodule "gt_profile_curie"]
path = web/profiles/contrib/gt_profile_curie
url = https://github.gatech.edu/ICWebTeam/gt_profile_curie.git
update = checkout
branch = master
ignore = dirty
shallow = TRUE
To initialize your local configuration file and fetch all the data from each project and check out the appropriate commit, run the following command:
git submodule update --init --recursive
To initialize your local configuration file and fetch all the data from each project and check out the appropriate commit, run the following command:
git submodule update --recursive
For more information about submodules, see the Git product documentation on modules: https://www.git-scm.com/docs/gitmodules
Documentation courtesy of Veronique Topping