Git Commands Flashcards
clone an existing repository
git clone ssh://user@domain.com/repo.git
create a new local repository
git init
show changed files in your local directory
git status
show changes to tracked files
git diff
add some changes in to the next commit
git add -p
commit all local changes in tracked files
git commit -a
commit previously staged changes
git commit
show changes over time for
git log -p
who changed what and when in
git blame
list all existing branches
git branch -av
switch HEAD branch
git checkout
create a new tracking branch based on a remote branch
git checkout --track
delete a local branch
git branch -d
list all currently configured remotes
git remote -v
show information about a remote
git remote show
add new remote repository, named
git remote add
delete a branch on the remote
git branch -dr
publish your tags
git push --tags
merge into your current HEAD
git merge
rebase your current HEAD onto
git rebase
abort a rebase
git rebase --abort
continue a rebase after resolving conflicts
git rebase --continue
use your configured merge tool to solve conflicts
git mergetool
use your editor to manually solve conflicts and (after resolving) mark file as resolved
git add
discard all local changes in your working directory
git reset --hard HEAD
discard local changes in a specific file
git checkout HEAD
shows file differences between staging and the last file version
git diff --staged
records file snapshots permanently in version history
git commit -m "
add to your .gitignore to suppress versioning of these things
*.log, build/, temp-*
lists all ignored files in this project
git ls-files --other --ignored --exclude-standard
lists all stashed changesets
git stash list
clear stash without applying it into working directory
git stash drop
create a new branch and also switch to it at the same time
git checkout -b