Skip to content

roa-2022/two-truths-and-a-lie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 

Repository files navigation

Two Truths and a Lie

Let's get to know each other better! We'll play an icebreaker called Two Truths and a Lie, but instead of chatting in person, we're going to use git and GitHub to chat about what the lie is. Read the instructions very carefully as you work through this exercise and let a teacher know if you need clarifications.

Setup

0. Cloning the repo and git iam

  • Clone this repo and navigate to it

    More about cloning

    In your browser find the clone URL in the sidebar and copy it. In your terminal, run the following command, replacing CLONE_URL with the URL you copied:

    cd ~/workspace
    git clone CLONE_URL
    cd two-truths-and-a-lie
  • Tell git who is driving, using git iam

    More about git iam

    This is how we credit commits under your name when you're working on an on-campus machine or (for online students) in VS Code LiveShare.

    • Online students, please install and configure git-iam (following the instructions in the remote-git-iam repo)
    • On the on-campus computers, git-iam is already set up for you
    • If you're working solo on your own machine, you will have configured git globally already, and you don't need git-iam
    git iam DRIVERS_GITHUB_NAME

Tell a lie

1. Make your changes

  • Create a new branch named for you and your partner

    More about branching

    To do this we use the git branch command. git branch on its own lists out all local branches, but when we give it an argument it creates a new branch. A new branch is a copy of the current branch with a different name.

    In your terminal, run the following command, replacing partner1 and partner2 with your name and your partner's name in any order you decide:

    git branch partner1-partner2      # e.g. emily-kelly
    git checkout partner1-partner2

    You could also do this in one step:

    git checkout -b partner1-partner2

    The result should be one new branch named after your pair.

  • Modify the file two-truths.md so that for each of you it contains your name, and three facts about you. One of these facts should be completely made up

    Tip
    • You should remove the entries for Neil Armstrong and Buzz Aldrin.

2. Share your work

  • Stage and commit your file to the project

    More about staging and committing

    Use the following commands:

    git add .
    git commit -m "Added truths and lies"
  • Push your branch to GitHub

    More about pushing
    git push origin YourName-PartnersName

Find the Lie

3. Prepare to bust

  • Find a pair to bust

    More about pairing

    On-campus students: a teacher will guide you to find the cohort mates with whom you're going to play lie detector. Ask your teacher who you're busting!

    Online students: Post in the general channel in Discord when your branch is ready to be busted. When you select another pair's branch to bust, mark their Discord message with an emoji reaction.

  • Pull your cohort mates' branch from GitHub into your local repository

    More about pulling
    git fetch
    git checkout THEIR_BRANCH
  • Create a new branch for your changes

    More about branching (again)
    git checkout -b THEIR_BRANCH-busted

    What is the difference between this command and the one in the previous step?

    git --help checkout

4. Bust some lies

  • Open two-truths.md and add the word LIE to the line you think is a lie

  • Stage the changed file and commit it

    More about staging and committing (again)
    git add two-truths.md
    git commit -m "Found the lie"

5. Fun with Github

  • Push this branch to GitHub

    More about pushing (again)
    git push origin THEIR_BRANCH-busted
  • Submit a pull request on GitHub of your changes. Be sure the pull request is from THEIR_BRANCH-busted into THEIR_BRANCH

    More about pull requests

    The top of your PR will look similar to this:

    Screenshot of the top of a Github pull request showing a PR from the "don-rich-busted" branch to the "don-rich" base branch

    DO NOT MERGE YOUR PULL REQUEST INTO MAIN!!

    Why not? What would happen if everyone merged their branches into main?


Come Clean

Now it's time to come clean (or not).

6. Reviewing PRs

  • Once someone has submitted a LIE pull request on your branch, comment on the pull request

    More about reviewing

    You might leave a comment such as...

    • "Yep you got it" or
    • "Nope but perhaps you really meant to choose #1" or (if you're devious)
    • "Nope, keep guessing".

    In any case, close the pull request and make sure the target branch is the correct one, not main.

Stretch

More about stretch challenges

If you finish the main challenge with time left over, try these activities to solidify what you learned:

  • Draw a diagram of the Git workflows you used in sections 0-5
  • Describe the workflow using your picture and words (i.e. not code) to your pair or a teacher
  • Make sure you understand all parts completely. You will be using this workfow extensively in the next nine weeks. Ask questions if anything is still unclear!

Further reading

More reading

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published