Basic Git snapshotting Flashcards
1
Q
How do you add all changes from a subdirectory?
A
git add –all :/ or git add -A :/
2
Q
How do you remove a file from the staging area, but leave the working directory unchanged?
A
git reset file
3
Q
How do you remove a file with Git?
A
git rm file
4
Q
How do you stop tracking a file without removing it?
A
**git rm –cached **file
5
Q
How do you undo the last 2 commits and changes?
A
git reset –hard HEAD^^
6
Q
How do you unstage a file from the index?
A
**git reset **file
7
Q
How do you reset the staging area to match the most recent commit, but leaving the working directory unchanged?
A
git reset