Git Flashcards

1
Q

what is a detached head state

A

we have checked out a commit that isn’t pointer to by any current branch or tag

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

how do we synchronise a repository

A

bring down remote changes - fetch

integrate local work - merge

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

what is a remote tracking branch

A

remembers positions of branches in the remote repository

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

describe merge

A

bring changes from one branch to another

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

which branch is affected by a merge

A

the one we have checked out

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

what is a fast forward merge

A

just change the commit that the branch points to

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

give the areas of git

A

workspace | staging area | local repository | upstream

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

what is init

A

creates an empty repository

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

what is git add

A

populates or adds changes

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

what is git commit

A

saves a snapshot

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

what is reflog

A

shows history and allows restore

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

what is git reset

A

moves the head to a specific commit

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

what is git revert

A

undoes a commit by creating a new one (done in public branches)

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

what is a hard reset

A

reset both index and working tree

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

what is a merge commit

A

merge branch into another where both have changed

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

what is a merge conflict

A

changes to a file in the same place, user must decide what to do

17
Q

what is rebase

A

copy commits across as though everything was done on the original branch

18
Q

what is squash

A

before rebase, combine commits

19
Q

give the git flow model

A

master branch for production code

development branch for development

also feature branches, hotfixes, release branch

20
Q

give a pro and a con of the git flow model

A

popular

complex

21
Q

give the GitHub flow model

A

feature branches off master. All master commits are deployable

22
Q

give the trunk based gitflow model

A

development on a single trunk branch

any branches for development are short clean and ephemeral

always release ready