Skip to content
Frank Siderio edited this page Mar 22, 2018 · 1 revision

Getting Started

TODO: Table of contents

Terminology

Term Meaning
Repository (Repo) All the files of a git project (code tab on Github)
Git Command line tool that manages versions of a project's code
Github A website that allows users to put their git projects in the cloud (and access them easily)

Clone This Repository

TODO: pictures/gifs

  1. Download Git for your machine.
    • NOTE: Please install the command line application, NOT the GUI (graphical user interface) version.
  2. Open the command line (Windows) or terminal (Mac)
  3. Type cd and then enter the path of the directory where you want to download the repository.
    • cd stands for "change directories." The terminal/command line acts as a text-based version of your file-system.
    • In order to download a repository to the correct place, you have to cd to the place where you want to download it.
  4. Enter git status.
    • If your command line says Command "git" not recognized or something along those lines, please try installing git again.
    • If your command line says fatal: Not a git repository (or any of the parent directories): .git please proceed!
  5. Enter git clone https://github.com/marist-sga/sga-website.git
    • Your command line should produce a lot of download messages.
    • Behind the scenes git is going to the url after clone (this repo), and downloading all those files into your current directory.
  6. After git is done downloading all the files, enter
    • Mac ls
    • Windows dirs
  7. You should see the top level folders for the website. Go to Windows Explorer on Windows or the Finder on Mac and check to see if those files are there (they should be).
  8. Open the project with your favorite text editor (Atom or Sumblime)

Making Changes

  1. Make changes to the files you want and save them.
  2. Go to the command line or terminal and cd to the sga-website git repository folder on your machine.
  3. Enter git status to view which branch you're on and which files need staging.
    • If it stays On branch development please switch to a different branch.
    • There should be a section of "Unstaged Files" (the files you changed).
  4. Type git add then file name of an unstaged files.
    • git add tells git "yes, please track these files for me"
    • Tip: instead of typing git add filename, enter git add . to add all unstaged files.
  5. Enter git commit -m "Short descriptions of the updates I made"
    • The commit command tells git "Yes, please save my progress at this point using the files I've staged"
    • The -m is called a flag. It's an optional addition to the commit command. It stands for message. It allows you to create a message to go along with your commit.
    • Please provide a message with every commit you make. It doesn't have to be long, just a quick update.
  6. Enter git push origin branchName
    • push takes all your current commits and lets git know that you want to keep those changes.
    • origin is the default name of the repository that's on the cloud (Github in this case). git has two repositories: local and remote. The local repo is on your machine. The remote repo is the one you see on Github.
    • branchName Please put your branchName here. Please do not push to master.

Branches

  1. Branches are used so developers can work separately on the same project and so the changes they make can be reviewed later in the pull request before they are merged into the base branch (development).
  2. Naming convention:
  • The branch name should correlate to what you're working on. So if you had to create a page called James Bond your branch name would be jamesBond or jamesBondPage. As long as the branch correlates to what you're working on that is fine.
  1. How to use branches:
  • Enter git branch your-branch-name this creates a new branch. NOTE: It is case sensitive.
  • Enter git checkout your-branch-name this switches to the new branch.
  • To make sure you did it correctly enter git branch and if your branch is highlighted in green then you did it! Yay!
  • To just switch to a branch that is already created use git checkout branch-you-want-to-switch-to

NOTE: You should not be making changes on the development branch (like ever) or else you will be mocked (and you don't want that).

Clone this wiki locally