Basic GIT Commands Flashcards
working directory
where you have a local copy of the git repository checked out
staging area
where files are added before being committed
git init
initializes a directory as a Git repository
git clone [url]
copy a git repository so you can add to it
git add [file]
adds a new file or new modifications of an existing file to the staging area
git status -s
view the (short) status of your files in the working directory and staging area
git diff
shows diff of unstaged changes
git diff
cached
git diff HEAD
show diff of all changes (staged or unstaged)
git diff
stat
git commit -m ‘message’
records a snapshot of the staging area (all those files and modifications that have been added to it)
git commit -a
automatically stage all tracked, modified files before the commit
git reset HEAD
[file]
git branch
list your available branches
git branch [branchname]
create a new branch
git checkout [branchname]
switch to a new branch context