Skip to content

Instantly share code, notes, and snippets.

@klaeufer
Last active March 21, 2022 17:55
Show Gist options
  • Save klaeufer/869ed974791256297049dee2dd920414 to your computer and use it in GitHub Desktop.
Save klaeufer/869ed974791256297049dee2dd920414 to your computer and use it in GitHub Desktop.
Loyola COMP 271 GitHub account creation

Loyola COMP 271: GitHub-Based Project Workflow

Individual activity

Collaborate with your classmates on a conceptual level but do not share code. Submit individually.

Learning Objectives

  • Get started with Git source code management
  • Make sure you can access the course examples on GitHub
  • Make sure you can use your development environment to modify and update your projects on GitHub

GitHub account creation

This is a one-time sequence of steps.

  1. Create a GitHub account (if you do not have one already).

  2. Request the GitHub Student Developer Pack using your official Loyola email address (this should give you unlimited private repositories for free).

Repository import

This is a one-time-per-project sequence of steps.

  1. Copy this existing cs2-lab0-hello-java example in these steps:

    • Copy the repo URL https://github.com/LoyolaChicagoCode/cs2-lab0-hello-java.
    • On the GitHub page, click the big plus sign in the top right corner.
    • Select import repository.
    • Paste the URL as the old repository's URL.
    • Enter cs2-lab0-hello-java as the name of your new repository.
    • Be sure to mark the new repository as private. If this does not work, ensure that you have properly requested the Student Developer Pack. Making your repository private is not critical for this project but will be required beyond this project for the rest of the course.
  2. Before you continue working on this project, give the TA and the instructor access to your repo by following these steps:

    • Press settings (the little gear symbol) on the right of the top menu bar.
    • Under collaborators and teams add us as collaborators with read/write privileges.
    • Notification will occur automatically.

Cloning, editing, committing and pushing your code from/to your remote GitHub repo

In this section, you will close the (somewhat less frequent) outer development cycle, consisting of

  • clone a remote repo (or pull your own or someone else's recent changes)
  • change (edit-compile-test/run locally - usually a more frequent step)
  • commit your changes (locally)
  • push your changes to the remote repo
  1. Do not follow the instructions in the README file of your cs2-lab0-hello-java projects. Follow only the instructions provided right here.

  2. To clone through the IDE,

    • on the web page for your own private remote GitHub repository cs2-lab0-hello-java, use the green clone or download button to copy the HTTPS-based repository URL
    • in IntelliJ IDEA, VCS > Get from version control > GitHub > log in using your credentials
    • choose the desired remote GitHub repository cs2-lab0-hello-java from the list and press clone
    • "You have checked out an IntelliJ IDEA project ..." > press yes
    • if you don't already have Git installed, IDEA might prompt you to download it or, on a Mac, the XCode command line tools
  3. You are now ready to make changes to your repository (inner edit/compile/run cycle)

  4. To commit and push through the IDE,

    • choose from the top-level menu

      VCS > Commit
      
    • enter a very brief description of the changes you are committing

    • from the dropdown in the bottom right corner, choose commit and push

    Alternatively, to commit from the command line,

    cd your-project-root
    git commit -asm "brief description of changes"
    git push
    
  5. Finally, visit the web page of your remote GitHub repository and navigate to one of the source files you have changed to verify that the change is there.

Congratulations, you have now pushed your changes to your remote GitHub repository!

Submission

Make an inline submission in Sakai by pasting your GitHub repository URL of the form

https://github.com/MyGitHubUserID/cs2-lab0-hello-java

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment