/git-workshop

Repo for the Git Workshop hosted by SCE

Primary LanguageHTML

git-workshop

Welcome to the Git Workshop hosted by SCE

Today we are going to learn the following:

  • What is Git/GitHub
  • Basic Version Control
  • Pulling and Pushing Branches
  • Switching/Creating Branches

First Steps:

  1. Install Git
  • If you dont have Git installed, you will need to install it onto your operating system
Operating System Relevant Links
Windows Link Here
Mac Link Here
Linux Link Here
Additional Notes for Mac - There are several ways to install git onto your system. of the options, we reccomend homebrew which you can install with the following command:
$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)

Cloning the repo:

  1. Next lets try cloning the repo.
  • For this we will be using git clone.
  • Make sure you are in the folder you want to put the repo into
git clone https://github.com/SCE-Development/git-workshop.git

Creating your branch:

  1. Now we are going to create a branch specifically for you to work on. There are two types of branches that we can use
Local Remote
Stored on your computer Stored on Github
  • Today we will be creating a local branch and publishing it onto the workshop repository

We can create our branch a couple different ways:

Using Git Checkout git checkout -b [INSERT YOUR BRANCH NAME]
Using Git Branch git branch [INSERT YOUR BRANCH NAME]

git checkout [INSERT YOUR BRANCH NAME]


Pushing your changes:

  1. We want to make sure we are currently on our new branch.
  • Make sure to use git branch to view the branch you are on.

  • You can switch to your branch by using "git checkout [INSERT YOUR BRANCH NAME]"

    Steps:

    1. Change line 144 in your index.html to your name.
    2. In your terminal, you want to commit the changes you have made so type the following:
    git commit -m "[INSERT YOUR MESSAGE HERE]" index.html
    
    1. Once this is complete, you've officially made your first commit.
    2. Then type git push into your terminal

Check for everyone else's branches

  1. Remember git fetch? Now we should be able to see everyone else's branches on the remote repository when we type git fetch.

Congrats, you know the basics of committing and pushing to Git!