-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit.quiz
More file actions
99 lines (70 loc) · 3.17 KB
/
git.quiz
File metadata and controls
99 lines (70 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// this is the url for the parent
url: https://jshively37.github.io/
// this is the title of the quiz
# Git
1) Which of the following is the correct way to initialize a new Git repository?
- git add .
- git commit
* git init
- git bash
2) Which git command do you use to upload local repository content to a remote repository?
- git pull
* git push
- git commit
- git fetch
3) Which command would you use to stage a single file called called my_awesome_script.py so we can commit it?
- git add .
* git add my_awesome_script.py
- git add new
- git push my_awesome_script.py
git add . will work but the request was just for a single file.
4) How you create a new commit with the message "Bugfix #1"?
- git commit .
- git commit "Bugfix #1"
* git commit -m "Bugfix #1"
- git push "Bugfix #1"
5) Which command will allow you create a branch called feature/bugfix and switch to that branch at the same time?
- git checkout feature/bugfix
* git checkout -b feature/bugfix
- git branch -checkout feature/bugfix
- git branch -c feature/bugfix
6) After you install Git and prior to issuing the first commit, which two configuration properties does the tool expect to be configured?
* username and email address
- username and password
- email address and password
- username and IP address
7) Which command is not used to determine what branch you are on?
- git branch
- git status
* git current
8) You made an unneccessary change to oops.py in your working directory. What command would discard the uncommitted changes to oops.py? * git checkout -- oops.py
- git rm --cached oops.py
- git checkout --replace oops.py master
- This feature does not exist.
9) Which command will download https://github.com/user1/awesome_repo.git to your local computer?
- git fork https://github.com/user1/awesome_repo.git
* git clone https://github.com/user1/awesome_repo.git
- git commit https://github.com/user1/awesome_repo.git
- git pull https://github.com/user1/awesome_repo.git
10) Which command will incorporate changes from a remote repository into the current branch?
- git commit -m "Get latest changes"
* git pull
- git push
- git merge
11) You have done git add readme.MD. You would like to remove the file from the staging area but still keep it on disk. Which command do you use?
- git rm readme.MD
* git rm --cached readme.MD
- git rm -f readme.MD
- Best way is just use explorer to move readme.MD to another directory, do a commit, and then move the file back.
git rm -f will delete the file from the staging area and the disk. git rm --cached keeps the file on teh disk but removes from staging.
12) Which command will compare bugfix1 and bugfix2?
- git push remote --tags
- git merge bugfix1 bugfix2
* git diff bugfix1 bugfix2
- git diff master bugfix1
13) How do you resolve a conflict in git?
- git automatically resolves conflicts
* edit the affected files, run git add, and then do a git commit
- run git add, and then do a git commit
- edit the affected files, and then do a git commit
https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-using-the-command-line