Git GitHub and GUI

Goals

By the end of this lab, you will be able to:

Introduction to Git and GitHub

By far, the most widely used modern version control system in the world is Git. Git is an actively maintained open source project originally developed in 2005 by Linus Torvalds, the creator of the Linux operating system kernel.

Git is responsible for keeping track of changes to content (usually source code files), and it provides mechanisms for sharing that content with others. GitHub is a company that provides Git repository hosting. GitHub should not be confused with Git itself.

Our lab machines are pre-installed with Git (https://git-scm.com/). However, if you want to use Git on your own computer, feel free to check this tutorial on how to install Git.

Also, Feel free to watch this video to get a quick idea on the mechanism of GitHub.

Basic Git Commands

  1. git clone GIT_URL - Download a copy of a repository
  2. git pull - Update your repository with latest changes from remote
  3. git add - Add file(s) to your staging area
  4. git commit - Record your snapshot into your history; "bless" your work
  5. git push - Upload your changes to the remote repository (e.g., GitHub)
  6. git log - Show commit logs

Part 1: Set up a GitHub account

If you don't already have a GitHub account go to the GitHub sign-up page (https://github.com/join) and create one.

Part 2: Create a new repository

Part 3: Clone the repository

Part 4: Make changes to the git directory

cd JavaGUI

Part 5: Commit and push changes

git status
git add --all
git commit -m "added GUIDemo.java into my first project"
git push
        setTitle("Bigger/Smaller");
setSize(200, 100);

       setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       panel = new JPanel();
       biggerButton = new JButton("BIGGER");
       smallerButton = new JButton("SMALLER");
       biggerButton.addActionListener(new ButtonHandler());
       smallerButton.addActionListener(new ButtonHandler());
       add(panel);
       panel.add(biggerButton);
       panel.add(smallerButton);
       setVisible(true);

Part 6: Modifying the GUI

  • Once you have tested your change, commit it and push it to GitHub.
  • Grading

    Read the Grading Criteria below carefully to get an idea of what deliverables will be used for grading.

    Grading Criteria