Udacity lesson 6 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

alter the most-recent commit

A

git commit –amend

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

reverse a given commit

A

git revert number_of_the_commit

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

delete a commit

A

git reset commits_number_or_relative_reference

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

what does git commit –amend do?

A

lets you provide a new commit message, or

you could edit, stage and save files with changes that should logically belong to this commit and not to a commit of their own, and then use git commit –amend, and these changes will be added to that old commit

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

I’ve forgotten to make some changes that belong to my last commit. what to do?

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

what does git revert number_of_the_commit do?

A

Git takes the changes that were made in commit and does the exact opposite of them, and then makes a commit to reflect this change

If a character is added in commit A, then Git will make a new commit where that character is deleted. It also works the other way where if a character/line is removed, then reverting that commit will add that content back!

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

reset vs revert

A

Reverting creates a new commit that reverts or undos a previous commit. So you have all the commits on the branch: both initial one and the reverted one

Resetting, on the other hand, erases commits, so you can’t undo this

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

I’ve reset a commit. is there a way back?

A

yes, for about 30 days. git reflog gives you access to the deleted content

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

relative referencing of commits

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

what can git reset commits_reference do?

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