Windows - Git with Atom GUI Tutorial

  1. Install Command Line
  2. Setup Gitlab
  3. Cloning the Repository
  4. Opening Up An Existing Local Repository
  5. Staging, Committing, Pushing

Installing Git Command Line

  1. For Windows, you must download Git Bash in order to get Git on your machine. Go to https://gitforwindows.org/ and click "Download". Instructional Image
  2. After downloading and running the installation, hit "Yes" to allow for changes. Instructional Image
  3. Go through the prompts hitting "next" each time with the default options.
    Instructional Image Instructional Image Instructional Image Instructional Image Instructional Image Instructional Image Instructional Image Instructional Image Instructional Image Instructional Image
  4. Search for "Git Bash" and open up the Git Bash command line. Instructional Image
  5. Enter in the following commands followed by the enter key substituting your username and email (use your CSE email if you are a CSE student and UW email if you are not) in order to let Git know who you are.
    git config --global user.name "YOUR_USERNAME"
    git config --global user.email "your_email_address@example.com"
    Instructional Image

Setting up GitLab to work with your computer.

  1. Navigate to https://gitlab.cs.washington.edu/users/sign_in where you will sign in to GitLab for the first time. Use your CSE ID if you are in the CSE major. Otherwise, use your UW NetID. Instructional Image
  2. After that, switch to GitBash where you will run this command to generate a unique key to identify your computer with your email address substituted in. LEAVE THE FILE AND PASSPHRASE BLANK! (It will break things if you don't) Just hit enter for both. If it prompts you to overwrite the file, type "y" then hit enter.
    ssh-keygen -o -t rsa -b 4096 -C "your_email_address@example.com"
    Instructional Image
  3. Then, copy this unique key to our clipboard by running the following command.
    cat ~/.ssh/id_rsa.pub | clip
    Instructional Image
  4. With the key copied, navigate to https://gitlab.cs.washington.edu/profile/keys. There you will paste your copied key into the textbox and hit "Add key". Instructional Image
  5. Confirm that you set the key up correctly by navigating to Git Bash again and running:
    ssh -T git@gitlab.cs.washington.edu
    Respond with "yes" to adding GitLab as a known host. You should see a nice welcome message in response. Instructional Image

Cloning the Repository

Install Atom if you have not already from here: https://atom.io/

Instructional Image
  1. After opening Atom, open up the "Command Palette" by using the menu bar or hitting "Ctrl+Shift+P". Instructional Image
  2. Type in "Clone" and select "Github: Clone". Instructional Image
  3. Copy the "Clone with SSH" URL from the GitLab repository you would like to clone. Instructional Image
  4. Paste in the URL to clone first then modify the location to a folder that exists and that you will be able to access easily later. Then hit the "Clone" button (It may take a couple of seconds to complete). Instructional Image
  5. Your repository should now show up in the Project Viewer on the left side. Instructional Image

Opening Up An Existing Local Repository

  1. With Atom Open, select "File > Add Project Folder" from the menu bar or press "Cmd+Shift+O" or "Ctrl+Shift+O". Instructional Image
  2. Navigate to the existing repository folder, select it, and press "Open". MAKE SURE THAT IT IS THE MAIN DIRECTORY OF THE REPOSITORY! I does not work if it is a single file or any other directory, even if the repository is somewhere inside of it. Instructional Image
  3. Your repository should now show up in the Project Viewer on the left side. Instructional Image

Staging, Committing, Pushing

  1. Open up the Git GUI by clicking on the "Git" button in the bottom right. Instructional Image
  2. That will open up a Git View showing the "Unstaged" changed, the changes selected to be "Staged", and previous commits. Unstaged changes are any files that have been changed or new files added to the directory. By hitting "Stage All", you select all of the changed to be committed to the online repository. You can also select individual changes to stage. Instructional Image
  3. You should hit the "Fetch" button first down at the bottom to pull any existing changes from the online repository that might not be on your local one. Instructional Image
  4. Once you have staged the changes you want to commit, you can type in a descriptive commit message and hit "Commit to master". Instructional Image
  5. Finally, you need to hit "Push" to send your local commit to the online repository. Instructional Image