Git Flashcards
When would you use:
git commit - -amend ?
When you need to modify your most recent commit. Git commit —amend allows you to combine stages changes with your most recent commit and edit the commit message.
How can you view changes to a file that have not been committed?
git diff
How can you view the commit history for a for a repository?
git log
What is the .gitignore file used for?
This file contains a list of files and/or directories that you do not want included in the git repository.
What are the arguments used in git diff when comparing repositories?
git diff [original content] [updated content]
Ex: git diff origin/main main
-compares remote repository to local
When is git pull used?
When you want to merge changes made in one git repository into another. For example you made changes to your local copy of the code base and wish to merge them into the remote on GitHub.
What is a fast-forward merge in git?
Moves the commit history of, for example, the local unchanged repo forward to match the commits fetched from the remote branch.