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!
git
is 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 initiate
in 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 add
to 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 add
to the repository on your computer with the message cool message attached.true
- The command
git remote add origin url
associates to your repo an online server calledorigin
, that can be reached at the urlurl
true
- If you type
git push -u origin master
you get the code from the online server calledorigin
onto your computer.false
- If you type
git push -u origin master
you send the changesadd
ed to the previouscommit
s to the online server calledorigin
.true
- saying
git pull origin master
fetches the repo fromorigin
and merges it into your local repo.true
- After
git pull
ing my collaborators' code fromorigin
,git diff HEAD
shows the difference between my last commit and the latest version onorigin
true
- 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 reset
command.true
- In step 1.16 of https://try.github.io/,
git reset
deletesoctofamily/octodog.txt
from youroctofamily
directory.false
- creating
branch
es allows you to work on several verions of your code before deciding which one to use eventually.true
- You create a new branch called
newbranch
with the commandgit create branch newbranch
false
- You switch to a different branch with
git switch branch
false
- Suppose you have file
octocat.txt
on themaster 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 fileoctocat.txt
has been removed from themaster
branch.false
- Suppose you have file
octocat.txt
on themaster 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 fileoctocat.txt
has been removed from themaster
branch.false
- Suppose you have file
octocat.txt
on themaster 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 fileoctocat.txt
has been removed from themaster
branch.true