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!
gitis a version control system.true- You can create a git repository anywhere on your computer where you have write access.
true - You create an empty git repo by writing
git initiatein a terminalfalse - The new file octocat.txt being untracked means that git sees a new file in this repo.
true - If you tell git to
git add octocat.txt, the file will be saved to an online server.false - If you tell git to
git commit -m 'cool message', it will save all files that you staged for commit withgit addto an online server with the message cool message attached.false - If you tell git to
git commit -m 'cool message', it will save all files that you staged for commit withgit addto the repository on your computer with the message cool message attached.true - The command
git remote add origin urlassociates to your repo an online server calledorigin, that can be reached at the urlurltrue - If you type
git push -u origin masteryou get the code from the online server calledoriginonto your computer.false - If you type
git push -u origin masteryou send the changesadded to the previouscommits to the online server calledorigin.true - saying
git pull origin masterfetches the repo fromoriginand merges it into your local repo.true - After
git pulling my collaborators' code fromorigin,git diff HEADshows the difference between my last commit and the latest version onorigintrue - Octocat gets depressed when ocotodog becomes part of the octofamily.
true - you can unstage a file, i.e. avoid it being included in your next commit by using the
git resetcommand.true - In step 1.16 of https://try.github.io/,
git resetdeletesoctofamily/octodog.txtfrom youroctofamilydirectory.false - creating
branches allows you to work on several verions of your code before deciding which one to use eventually.true - You create a new branch called
newbranchwith the commandgit create branch newbranchfalse - You switch to a different branch with
git switch branchfalse - Suppose you have file
octocat.txton themaster branchand you go through the following sequence of commands:git branch newbranchgit checkout newbranchgit rm octocat.txtgit commit -m 'removed octocat.txt'then the fileoctocat.txthas been removed from themasterbranch.false
- Suppose you have file
octocat.txton themaster branchand you go through the following sequence of commands:git branch newbranchgit checkout newbranchgit rm octocat.txtgit commit -m 'removed octocat.txt'git checkout masterthen the fileoctocat.txthas been removed from themasterbranch.false
- Suppose you have file
octocat.txton themaster branchand you go through the following sequence of commands:git branch newbranchgit checkout newbranchgit rm octocat.txtgit commit -m 'removed octocat.txt'git checkout mastergit merge newbranchthen the fileoctocat.txthas been removed from themasterbranch.true