Git_1 Flashcards
(10 cards)
What will the following command print to the Terminal
git remote -v
A list of remote repositories and their URLs
What command would let you modify your previous commit
–amend
Which of the following is true when you use the following command.
git add -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
What command would you use to create a new git repository?
git add
git start
git new
git init
git init
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?
Checkout the beta branch and run
git merge push-notification.
What happens when you clone git repository
A copy of the repository would be created on your local machine
Version Control Systems are category of software tools that
help a software team to manage changes of source code over the time
What commands would you use to force an overwrite of your local files with the master branch
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
After you make changes to a local repository, you run the following command. What will this do?
git commit -a -m “Refactor code base”
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.
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());
❌ assertEquals(str.split(‘ ‘)[1], ‘World’);
split takes a string not a character
❌ assertEquals(3, str.length());