tags | languages |
---|---|
git, github, bash, command line, ironboard, tutorial |
bash |
On Ironboard, 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 IronBoard team
To complete this lab you will have to:
- Fork the lab via github.
- Clone your fork.
- Create a new file.
- Commit that file.
- Push that commit to your fork.
- 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:
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.
- Click on the Fork Button
- Fork it to your personal github account.
- Make sure you are on your fork of the lab.
You should see something like this, once you've forked the repository:
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.
- Copy your Clone URL, it should start with https://
- 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.
- Enter in your github credentials.
Note: If you have 2-factor-authentication on github turned on this won't work. Turn it off from your settings
- Your clone should now exist in a new directory named after the lab.
- cd into the lab directory so you can get to work!
Now that you have forked and cloned your fork, your goal is simple. Just create a new file within this lab.
- 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
- Simply create a file. It doesn't matter what you call it.
touch my-new-file.txt
- Once you've done that, run
ironboard
on your terminal, which will run one test that's in thespec/
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 Ironboard, indicating the local build is passing:
- Add it to the repo, staging it for commit.
git add my-new-file.txt
- Confirm that the file is staged for commit with
git status
- Commit the file.
git commit -am "My first commit"
- Push that to your fork, up to github.
git push origin master
- Go to github and confirm the push.
Open the lab in github (the end of step 7 above).
- Click on the branch comparison icon from the repository home.
- Click Create Pull Request
- Confirm the Create Pull Request
- Look on Ironboard again and you should see a confirmation of that pull request being opened and a remote build passing: