Git Flashcards
Use git f____ to retrieve new work done by other people
Use git fetch to retrieve new work done by other people
command you use to view the changes in the files you are going to commit
git diff
view the changes in the staging area
git diff –cached
If you seem to have lost your history, check the r____ as your safety net.
If you seem to have lost your history, check the reflog as your safety net.
git reflog
To search the commit log for a text pattern:
git log –grep=”text here”
git log –grep=word
output git log with the first line only
git log –oneline
view the changes in all previous commits
git log -p
discard all changes you made in the working tree
git restore .
To unstage all files from the current change set:
git reset
The major benefit of rebasing (over merging) is that you get a much cleaner project h_____
The major benefit of rebasing is that you get a much cleaner project history
The golden rule of git rebase is to never use it on p____ branches.
The golden rule of git rebase is to never use it on public branches.
So, before you run git rebase, always ask yourself, “Is anyone else looking at this branch?” If the answer is yes, take your hands off the keyboard and start thinking about a non-destructive way to make your changes (e.g., the git r____ command).
So, before you run git rebase, always ask yourself, “Is anyone else looking at this branch?” If the answer is yes, take your hands off the keyboard and start thinking about a non-destructive way to make your changes (e.g., the git revert command).
If you would prefer a clean, linear history free of unnecessary merge commits, you should reach for git r____ instead of git merge when integrating changes from another branch.
If you would prefer a clean, linear history free of unnecessary merge commits, you should reach for git rebase instead of git merge when integrating changes from another branch.
The git s___ command takes your uncommitted changes (both staged and unstaged), saves them away for later use, and then reverts them from your working copy
The git stash command takes your uncommitted changes (both staged and unstaged), saves them away for later use, and then reverts them from your working copy
You can reapply previously stashed changes with git s____ p__
You can reapply previously stashed changes with git stash pop