Git 2 Flashcards

1
Q

What does git log –pretty=format fo

A

It makes the output of git log with a specific format

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

Mention 5 specifiers for git log –pretty=format

A

%H commit hash
%h commit abv hash
%T tree hash
%t abv tree hash
%P parent hashes
%p abv parent hashes
%ae author email
%an author name
%ad author date(respects the –date option)
%ar author relative date
%s subject

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

An equivalent of git reset HEAD <file> is</file>

A

git restore –staged <file></file>

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

What does git remote -v

A

It lists all the remotes with its URLs

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

What does git fetch <remote> do?</remote>

A

It fetches all the branches form that remote and also creates branches <remote>/<branch></branch></remote>

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

What does git pull do?

A

It fetches the remote that is set up to follow for your current branch and the merges it.

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

What does git branch –move

A

Renames branch

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

What is the difference between a lightweight and annotated tag

A

Lightweight tags only creates a reference to a commit, annotated are objects with its own hash that stores metadata (including a message) and the reference to the commit

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

What does git tag -s do

A

-s option signs the annotated tag and

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