git help command or git command --help |
Show help option for a command |
git init |
Create a repository in the current directory |
git clone url location |
Clone a remote repository into a subdirectory |
git add path |
Add file or files in directory recursively |
git rm path |
Remove file or directory from the working tree |
git rm -f path |
Force deletion of file(s) from disk |
git mv path destination |
Move file or directory to new location |
git mv -f path |
Overwrite existing destination files |
git checkout file |
Restore file from current branch |
git checkout -f file |
Overwrite uncommitted local changes |
git status |
Show status of the working tree |
git diff path |
Show diff of changes in the working tree |
git diff HEAD path |
Show diff of stages and unstaged changes |
git add path |
Prepare file for commit |
git reset HEAD path |
Unstage file for commit |
git commit |
Commit files that has been staged (with git-add) |
git commit -a |
Prepare all modified files |
git reset --soft HEAD^ |
Undo commit & keep changes in the working tree |
git reset --hard HEAD^ |
Reset the working tree to the last commit |
git clean |
Clean unknown files from the working tree |
git log path |
View commit log, optionally for specific path |
git log from to |
View commit log for a given revision range |
git log --stat |
List statistics for each revision |
git log -S pattern |
Search history for changes matching pattern |
git blame file |
Show file annotated with line modifications |
git fetch remote location |
Fetch changes from a remote repository |
git pull remote location |
Fetch and merge changes from a remote repository |
git push remote location |
Push changes to a remote repository |
git remote |
List remote repositories |
git remote add remote url |
Add remote to list of tracked repositories |
git branch |
List local branches |
git checkout branch |
Switch working tree to branch |
git checkout -b branch |
Create branch before switching to it |
git branch -f branch rev |
Overwrite the existing branch, but start from revision |
git merge branch |
Merge changes from a branch |
find start [options] [commands] |
look for files or directories with specified properties and take specified actions |
-type d |
match directories |
-type f |
match files |
-name 'pattern' |
match things with specific names |
-maxdepth n |
maximum search depth |
-mindepth n |
minimum search depth |
-print |
print matches |
find start [options] [commands] |
look for files or directories with specified properties and take specified actions |
-type d |
match directories |
-type f |
match files |
-name 'pattern' |
match things with specific names |
-maxdepth n |
maximum search depth |
-mindepth n |
minimum search depth |
-print |
print matches |
find start [options] [commands] |
look for files or directories with specified properties and take specified actions |
-type d |
match directories |
-type f |
match files |
-name 'pattern' |
match things with specific names |
-maxdepth n |
maximum search depth |
-mindepth n |
minimum search depth |
-print |
print matches |