Basic commands Flashcards
What flag is used to both stage and commit tracked files within a working directory?
-a
as in:
git commit -a
How do you commit a file in git?
git commit
What command allow you to see the history within git?
“git log” or “git show”
How do you revert files from a modified state to the equivalent located within the repository
git checkout FILENAME
How do you unstage a file
git reset HEAD FILENAME
how to do you make a global alias within get
git global alias.ALIAS name “COMMAND GOES HERE”
How do update your git repository to accomodate for deletions
git add -u[pdate]
how to update your get repo to stage all changes (both deletions and renames etc)
git add -A
what is the command to inspect the global config file within the default editor
git config –global -e
What are the differences between “git add -A” “git add .” or “git add -u”
– git add -A
stages all changes (deletions, updates in names and modifications, and new files)
– git add .
stages new files and modifications, without deletions
– git add -u stages modifications and deletions, without new files
What is the command to save your work and recall it at a later date?
“git stash”
and to recall it. It’s “git stash pop”
“git stash pop”
What is the command to check the URLs associated with a local repository and it’s respective remote repository
git remote -v
How do you create a branch and then check into it with one command?
git branch -b “NAMEOFBRANCH”
What is the command to list all branches
git branch -a
what is the command to list all files?
git ls-files