Git Flashcards
what is a detached head state
we have checked out a commit that isn’t pointer to by any current branch or tag
how do we synchronise a repository
bring down remote changes - fetch
integrate local work - merge
what is a remote tracking branch
remembers positions of branches in the remote repository
describe merge
bring changes from one branch to another
which branch is affected by a merge
the one we have checked out
what is a fast forward merge
just change the commit that the branch points to
give the areas of git
workspace | staging area | local repository | upstream
what is init
creates an empty repository
what is git add
populates or adds changes
what is git commit
saves a snapshot
what is reflog
shows history and allows restore
what is git reset
moves the head to a specific commit
what is git revert
undoes a commit by creating a new one (done in public branches)
what is a hard reset
reset both index and working tree
what is a merge commit
merge branch into another where both have changed
what is a merge conflict
changes to a file in the same place, user must decide what to do
what is rebase
copy commits across as though everything was done on the original branch
what is squash
before rebase, combine commits
give the git flow model
master branch for production code
development branch for development
also feature branches, hotfixes, release branch
give a pro and a con of the git flow model
popular
complex
give the GitHub flow model
feature branches off master. All master commits are deployable
give the trunk based gitflow model
development on a single trunk branch
any branches for development are short clean and ephemeral
always release ready