Skip to content

leojkwan/first-lab-ios-0615-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tags languages
git, github, bash, command line, learn.co, tutorial
bash

Your First Lab

On Learn, labs are exercises you have to complete.

The goal of this lab is to practice the workflow to complete a lab and to see if you can make a new file or directory using terminal.

Make sure you accept the invite on Github to the learn.co student organization

To complete this lab you will have to:

  1. Fork the lab via github.
  2. Clone your fork.
  3. Create a new file.
  4. Commit that file.
  5. Push that commit to your fork.
  6. Open a Pull Request for your fork.

Your first step is to scroll down to the bottom of the page, which will direct you to the lab on Github. You should see something like this:

Learn

Forking from Github

Forking is a feature of github that creates a copy of a repository on your account. When you solve a lab, you'll be coding the solution not on the deployed copy of the lab that everyone has access too, but rather, on your copy, your fork.

How to Fork

  1. Click on the Fork Button

Clicking on Fork

  1. Fork it to your personal github account.

Forking

  1. Make sure you are on your fork of the lab.

Your Fork

On Learn

You should see something like this, once you've forked the repository:

Learn.co Fork

Cloning from Github

Cloning means bringing down a copy of a git repository from a remote source (like Github). It is creating another copy of a repository on your computer and allowing your local copy to communicate and update the copy on github.

How to Clone

  1. Copy your Clone URL, it should start with https://

Your Fork Clone URL

  1. From your terminal, from your home directory (you can cd ~ to quickly jump there), type in: git clone and then paste the clone address you copied in step 1.

git clone

  1. Enter in your github credentials.

github authentication

Note: If you have 2-factor-authentication on github turned on this won't work. Turn it off from your settings

  1. Your clone should now exist in a new directory named after the lab.

All good

  1. cd into the lab directory so you can get to work!

All good

Solving this Lab

Now that you have forked and cloned your fork, your goal is simple. Just create a new file within this lab.

  1. You should be cd'd into this lab's directory. Confirm that your working directory in terminal is this lab: pwd

You should see something like: /Users/avi/first-lab

1

  1. Simply create a file. It doesn't matter what you call it.

touch my-new-file.txt

1

  1. Once you've done that, run learn on your terminal, which will run one test that's in the spec/ folder. This test is looking to see that you've added a new file. If you have the test passing on your computer, you should see something like this on Learn, indicating the local build is passing:

Local Build

  1. Add it to the repo, staging it for commit.

git add my-new-file.txt

1

  1. Confirm that the file is staged for commit with git status

1

  1. Commit the file.

git commit -am "My first commit"

1

  1. Push that to your fork, up to github.

git push origin master

1

  1. Go to github and confirm the push.

1

Opening a Pull Request

Open the lab in github (the end of step 7 above).

  1. Click on the branch comparison icon from the repository home.

1

  1. Click Create Pull Request

1

  1. Confirm the Create Pull Request

1

  1. Look on Learn again and you should see a confirmation of that pull request being opened and a remote build passing:

PR & Remote Build

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages