Things to remember GIT Flashcards
How to create a new Git repository
git init
How to inspect the contents of the working directory and staging area?
git status / gst
How to add files from the working directory to the staging area?
git add
How to show the difference between the working directory and the staging area?
git diff
How to permanently store file changes from the staging area in the repository?
git commit -m “message”
How to show a list of all previous commits?
git log / git lg
How to discard changes in the working directory?
git checkout HEAD filename
How to unstages file changes in the staging area?
git reset HEAD filename
How to reset to a previous commit in your commit history?
git reset commit_SHA (7-first-digits of the commit)
How to add all files at once to the stage?
git add .
How to temporarly save/retrieve files in order to switch branches without loosing everything?
git stash
git stash pop
How to update your previous commit?
create your changes, stage them with git add and then type the command git
commit –amend
How to set up an alias for each command?
git config –global alias.co “checkout” (co becomes checkout)
How to move Files in the terminal?
mv file.txt destinared_directory
How to rename files in Terminal?
mv file.txt newFile.txt