Git_1 Flashcards

(10 cards)

1
Q

What will the following command print to the Terminal
git remote -v

A

A list of remote repositories and their URLs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What command would let you modify your previous commit

A

–amend

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following is true when you use the following command.
git add -A

A

All new and updated files are staged

This stages all changes in your working directory, including:
Modified tracked files
New untracked files
Deleted files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What command would you use to create a new git repository?
git add
git start
git new
git init

A

git init

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Your current project has several branches; master, beta, and push-notifications. You’ve just finished the notification feature in the push-notification branch, and you want to commit it to beta branch. How can you accomplish this?

A

Checkout the beta branch and run
git merge push-notification.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What happens when you clone git repository

A

A copy of the repository would be created on your local machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Version Control Systems are category of software tools that

A

help a software team to manage changes of source code over the time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What commands would you use to force an overwrite of your local files with the master branch

A

git fetch –all
git reset –hard origin/master

(git pull –all is invalid command, you must specify remote branch or your local should be mapped

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

After you make changes to a local repository, you run the following command. What will this do?
git commit -a -m “Refactor code base”

A

Adds all modified files to staging area,
then commits them with a message.

git commit -a stages all tracked files that have been modified or deleted. It does not include new (untracked) files — you still need to run
git add newfile.java for those.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which of the assertations will fail after execution of the code below?
String str = “Hello World”;
assertThat(str, notNullValue());
assertFalse(str.isEmpty());
assertThat(str, containsString(“rl”));
assertEquals(str.split(‘’)[1], ‘World’);
assertEquals(3, str.length());

A

❌ assertEquals(str.split(‘ ‘)[1], ‘World’);
split takes a string not a character

❌ assertEquals(3, str.length());

How well did you know this?
1
Not at all
2
3
4
5
Perfectly