Git Quick Reference
Git Quick Reference
http://jonas.nitro.dk/git/quick-reference.html
File operations: git add path git rm path -f git mv path destination -f git checkout [rev] file -f Working tree: git status git diff [path] git diff HEAD path git add path git reset HEAD path git commit -a git reset --soft HEAD^ git reset --hard HEAD^ Show status of the working tree Show diff of changes in the working tree Show diff of stages and unstaged changes Stage file for commit Unstage file for commit Commit files that has been staged (with git-add) Automatically stage all modified files Undo commit & keep changes in the working tree Reset the working tree to the last commit Add file or files in directory recursively Remove file or directory from the working tree Force deletion of file(s) from disk Move file or directory to new location Overwrite existing destination files Restore file from current branch or revision Overwrite uncommitted local changes
1 de 3
http://jonas.nitro.dk/git/quick-reference.html
Working tree: git clean Examining History: git log [path] git log [from[..to]] --stat -S'pattern' git blame [file] Remote repositories remotes: git fetch [remote] git pull [remote] git push [remote] git remote git remote add remote url Branches: git checkout branch -b branch git branch git branch -f branch rev git merge branch Exporting and importing: git apply - < file git format-patch from[..to] git archive rev > file --prefix=dir/ --format=[tar|zip] Apply patch from stdin Format a patch with log message and diffstat Export snapshot of revision to file Nest all files in the snapshot in directory Specify archive format to use: tar or zip Switch working tree to branch Create branch before switching to it List local branches Overwrite existing branch, start from revision Merge changes from branch Fetch changes from a remote repository Fetch and merge changes from a remote repository Push changes to a remote repository List remote repositories Add remote to list of tracked repositories View commit log, optionally for specific path View commit log for a given revision range List diffstat for each revision Search history for changes matching pattern Show file annotated with line modifications Clean unknown files from the working tree
2 de 3
http://jonas.nitro.dk/git/quick-reference.html
Create tag for a given revision Sign tag with your private key using GPG List tags, optionally matching pattern
File has been modified File has been copied and modified File has been renamed and modified File has been added File has been deleted File has conflicts after a merge
3 de 3