Skip to content

Latest commit

 

History

History
59 lines (52 loc) · 3.61 KB

challenge-sol.md

File metadata and controls

59 lines (52 loc) · 3.61 KB

Github Challenge

Instructions

You should spend 15 minutes on https://try.github.io/ and then answer the following quiz. You may also find https://learngitbranching.js.org to be fun and helpful to play around with before taking the quiz.

Your answer should be contained in a text file (not .doc) and look something like:

true
false
false
true
...

i.e. there should be one column, and either true or false for each question. Have fun!

Questions

  1. git is a version control system. true
  2. You can create a git repository anywhere on your computer where you have write access. true
  3. You create an empty git repo by writing git initiate in a terminal false
  4. The new file octocat.txt being untracked means that git sees a new file in this repo. true
  5. If you tell git to git add octocat.txt, the file will be saved to an online server. false
  6. If you tell git to git commit -m 'cool message', it will save all files that you staged for commit with git add to an online server with the message cool message attached. false
  7. If you tell git to git commit -m 'cool message', it will save all files that you staged for commit with git add to the repository on your computer with the message cool message attached. true
  8. The command git remote add origin url associates to your repo an online server called origin, that can be reached at the url url true
  9. If you type git push -u origin master you get the code from the online server called origin onto your computer. false
  10. If you type git push -u origin master you send the changes added to the previous commits to the online server called origin. true
  11. saying git pull origin master fetches the repo from origin and merges it into your local repo. true
  12. After git pulling my collaborators' code from origin, git diff HEAD shows the difference between my last commit and the latest version on origin true
  13. Octocat gets depressed when ocotodog becomes part of the octofamily. true
  14. you can unstage a file, i.e. avoid it being included in your next commit by using the git reset command. true
  15. In step 1.16 of https://try.github.io/, git reset deletes octofamily/octodog.txt from your octofamily directory. false
  16. creating branches allows you to work on several verions of your code before deciding which one to use eventually. true
  17. You create a new branch called newbranch with the command git create branch newbranch false
  18. You switch to a different branch with git switch branch false
  19. Suppose you have file octocat.txt on the master branch and you go through the following sequence of commands:
    • git branch newbranch
    • git checkout newbranch
    • git rm octocat.txt
    • git commit -m 'removed octocat.txt' then the file octocat.txt has been removed from the master branch. false
  20. Suppose you have file octocat.txt on the master branch and you go through the following sequence of commands:
    • git branch newbranch
    • git checkout newbranch
    • git rm octocat.txt
    • git commit -m 'removed octocat.txt'
    • git checkout master then the file octocat.txt has been removed from the master branch. false
  21. Suppose you have file octocat.txt on the master branch and you go through the following sequence of commands:
    • git branch newbranch
    • git checkout newbranch
    • git rm octocat.txt
    • git commit -m 'removed octocat.txt'
    • git checkout master
    • git merge newbranch then the file octocat.txt has been removed from the master branch. true