GIT Flashcards
What is GIT?
Git is a Distributed Version Control system (DVCS). It can track changes to a file and allows you to revert back to any particular change.
What is ‘head’ in git and how many heads can be created in a repository?
A ‘head’ is simply a reference to a commit object. In every repository, there is a default head referred as “Master”. A repository can contain any number of heads.
What are Git repository hosting services you used?
Github, Bitbucket, Gitlab or you can specify if you have used something else here.
Describe: reset, rebase, checkout, merge
RESET resets (unstages) changes added to the index; undoes git add. discard all working copy changes since the last commit
REBASE is used to rewrite previously made commit objects.
CHECKOUT switch branches create a new branch and switch to it
MERGE merges together different branches (different histories, to be more exact)
Describe: add, commit, push
ADD adds your modified files to the queue to be committed later. Files are not committed
COMMIT commits the files that have been added and creates a new revision with a log… If you do not add any files, git will not commit anything. You can combine both actions with git commit -a
PUSH pushes your changes to the remote repository.
Shorter:
git add selects changes
git commit records changes LOCALLY
git push shares changes
What is a conflict
Conflict is when two commit objects have some changes in the same place
Longer: A ‘conflict’ arises when the commit that has to be merged has some change in one place, and the current commit also has a change at the same place.
git stash
git stash: a Clipboard for Your Changes
The “git stash” command can help you to (temporarily but safely) store your uncommitted local changes - and leave you with a clean working copy.
What Are The Advantages Of Using Git?
a) Data redundancy and replication
b) High availability
c) Only one.git directory per repository
d) Superior disk utilization and network performance
e) Collaboration friendly
f) Any sort of projects can use GIT