Git Flashcards
1
Q
git init
A
initialize a new Git repo
2
Q
git status
A
find out the current state of the repo
3
Q
git commit
A
take a snapshot of the repo at a certain time
4
Q
git add
A
stage new or changed files
5
Q
git diff
A
see what has changed in a repo since the last commit
6
Q
git reset
A
reset repo to a prior stat
7
Q
git checkout
A
look at the prior state of the repo and switch branches
8
Q
git branch
A
create a new branch
9
Q
git merge
A
merges branches
10
Q
git checkout -b
A
create and go to a new branch
11
Q
git branch -a
A
get a list of all the branches in the local repo
12
Q
git branch -D
A
delete a branch
13
Q
git commit -a
A
- a switch with the ‘commit’ command to automatically:
- “add” changes from all known files (i.e. all files that are already listed in the index)
- automatically “rm” files in the index that have been removed from the working tree
- perform the actual commit;
- “add” changes from all known files (i.e. all files that are already listed in the index)
14
Q
git commit -m
A
commit and add comment ‘COMMENT’
15
Q
git log
A
shows the commit logs