Git Flashcards

1
Q

When would you use:
git commit - -amend ?

A

When you need to modify your most recent commit. Git commit —amend allows you to combine stages changes with your most recent commit and edit the commit message.

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

How can you view changes to a file that have not been committed?

A

git diff

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

How can you view the commit history for a for a repository?

A

git log

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

What is the .gitignore file used for?

A

This file contains a list of files and/or directories that you do not want included in the git repository.

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

What are the arguments used in git diff when comparing repositories?

A

git diff [original content] [updated content]
Ex: git diff origin/main main
-compares remote repository to local

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

When is git pull used?

A

When you want to merge changes made in one git repository into another. For example you made changes to your local copy of the code base and wish to merge them into the remote on GitHub.

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

What is a fast-forward merge in git?

A

Moves the commit history of, for example, the local unchanged repo forward to match the commits fetched from the remote branch.

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