Git Flashcards
1
Q
3 parts of a Git project
A
- Working Directory
- Staging Area
- Repository
2
Q
How to: View status
A
git status
3
Q
How to: Add files to staging area (multiple)
A
git add
or multiple: git add
4
Q
How to: View changes
A
git diff
5
Q
How to: Start a new project
A
git init
6
Q
How to: Save changes from the staging area
A
git commit -m””
7
Q
How to: View commit history
A
git log
8
Q
What is the HEAD commit?
What does git show HEAD do?
A
The commit you are currently on
Shows the log info for the current commit and the changes that were committed
9
Q
How to: View the current commit
A
git show HEAD
10
Q
How to: Restore to last commit
A
git checkout HEAD
11
Q
What does git checkout HEAD do?
A
Rolls back (unstages) file changes in the staging area to last commit but does not discard changes from the working direcory