{"id":2073,"date":"2014-11-21T08:12:12","date_gmt":"2014-11-21T01:12:12","guid":{"rendered":"https:\/\/engineerball.com\/?p=2073"},"modified":"2014-11-21T08:15:04","modified_gmt":"2014-11-21T01:15:04","slug":"git-cheat-sheet","status":"publish","type":"post","link":"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html","title":{"rendered":"Git Cheat Sheet"},"content":{"rendered":"<h1>Git Cheat Sheet<\/h1>\n<p>Setup<\/p>\n<pre class=\"sheet\">-----\r\n\r\ngit clone &lt;repo&gt;\r\n  clone the repository specified by &lt;repo&gt;; this is similar to \"checkout\" in\r\n  some other version control systems such as Subversion and CVS\r\n\r\nAdd colors to your ~\/.gitconfig file:\r\n\r\n  [color]\r\n    ui = auto\r\n  [color \"branch\"]\r\n    current = yellow reverse\r\n    local = yellow\r\n    remote = green\r\n  [color \"diff\"]\r\n    meta = yellow bold\r\n    frag = magenta bold\r\n    old = red bold\r\n    new = green bold\r\n  [color \"status\"]\r\n    added = yellow\r\n    changed = green\r\n    untracked = cyan\r\n\r\nHighlight whitespace in diffs\r\n\r\n  [color]\r\n    ui = true\r\n  [color \"diff\"]\r\n    whitespace = red reverse\r\n  [core]\r\n    whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol\r\n\r\nAdd aliases to your ~\/.gitconfig file:\r\n\r\n  [alias]\r\n    st = status\r\n    ci = commit\r\n    br = branch\r\n    co = checkout\r\n    df = diff\r\n    dc = diff --cached\r\n    lg = log -p\r\n    lol = log --graph --decorate --pretty=oneline --abbrev-commit\r\n    lola = log --graph --decorate --pretty=oneline --abbrev-commit --all\r\n    ls = ls-files\r\n\r\n    # Show files ignored by git:\r\n    ign = ls-files -o -i --exclude-standard\r\n\r\n\r\nConfiguration\r\n-------------\r\n\r\ngit config -e [--global]\r\n  edit the .git\/config [or ~\/.gitconfig] file in your $EDITOR\r\n\r\ngit config --global user.name 'John Doe'\r\ngit config --global user.email johndoe@example.com\r\n  sets your name and email for commit messages\r\n\r\ngit config branch.autosetupmerge true\r\n  tells git-branch and git-checkout to setup new branches so that git-pull(1)\r\n  will appropriately merge from that remote branch.  Recommended.  Without this,\r\n  you will have to add --track to your branch command or manually merge remote\r\n  tracking branches with \"fetch\" and then \"merge\".\r\n\r\ngit config core.autocrlf true\r\n  This setting tells git to convert the newlines to the system's standard\r\n  when checking out files, and to LF newlines when committing in\r\n\r\ngit config --list\r\n  To view all options\r\n\r\ngit config apply.whitespace nowarn\r\n  To ignore whitespace\r\n\r\nYou can add \"--global\" after \"git config\" to any of these commands to make it\r\napply to all git repos (writes to ~\/.gitconfig).\r\n\r\n\r\nInfo\r\n----\r\ngit reflog\r\n  Use this to recover from *major* mess ups! It's basically a log of the\r\n  last few actions and you might have luck and find old commits that\r\n  have been lost by doing a complex merge.\r\n\r\ngit diff\r\n  show a diff of the changes made since your last commit\r\n  to diff one file: \"git diff -- &lt;filename&gt;\"\r\n  to show a diff between staging area and HEAD: `git diff --cached`\r\n\r\ngit status\r\n  show files added to the staging area, files with changes, and untracked files\r\n\r\ngit log\r\n  show recent commits, most recent on top. Useful options:\r\n  --color       with color\r\n  --graph       with an ASCII-art commit graph on the left\r\n  --decorate    with branch and tag names on appropriate commits\r\n  --stat        with stats (files changed, insertions, and deletions)\r\n  -p            with full diffs\r\n  --author=foo  only by a certain author\r\n  --after=\"MMM DD YYYY\" ex. (\"Jun 20 2008\") only commits after a certain date\r\n  --before=\"MMM DD YYYY\" only commits that occur before a certain date\r\n  --merge       only the commits involved in the current merge conflicts\r\n\r\ngit log &lt;ref&gt;..&lt;ref&gt;\r\n  show commits between the specified range. Useful for seeing changes from\r\n  remotes:\r\n  git log HEAD..origin\/master # after git remote update\r\n\r\ngit show &lt;rev&gt;\r\n  show the changeset (diff) of a commit specified by &lt;rev&gt;, which can be any\r\n  SHA1 commit ID, branch name, or tag (shows the last commit (HEAD) by default)\r\n\r\ngit show --name-only &lt;rev&gt;\r\n  show only the names of the files that changed, no diff information.\r\n\r\ngit blame &lt;file&gt;\r\n  show who authored each line in &lt;file&gt;\r\n\r\ngit blame &lt;file&gt; &lt;rev&gt;\r\n  show who authored each line in &lt;file&gt; as of &lt;rev&gt; (allows blame to go back in\r\n  time)\r\n\r\ngit gui blame\r\n  really nice GUI interface to git blame\r\n\r\ngit whatchanged &lt;file&gt;\r\n  show only the commits which affected &lt;file&gt; listing the most recent first\r\n  E.g. view all changes made to a file on a branch:\r\n    git whatchanged &lt;branch&gt; &lt;file&gt;  | grep commit | \\\r\n         colrm 1 7 | xargs -I % git show % &lt;file&gt;\r\n  this could be combined with git remote show &lt;remote&gt; to find all changes on\r\n  all branches to a particular file.\r\n\r\ngit diff &lt;commit&gt; head path\/to\/fubar\r\n  show the diff between a file on the current branch and potentially another\r\n  branch\r\n\r\ngit diff --cached [&lt;file&gt;]\r\n  shows diff for staged (git-add'ed) files (which includes uncommitted git\r\n  cherry-pick'ed files)\r\n\r\ngit ls-files\r\n  list all files in the index and under version control.\r\n\r\ngit ls-remote &lt;remote&gt; [HEAD]\r\n  show the current version on the remote repo. This can be used to check whether\r\n  a local is required by comparing the local head revision.\r\n\r\nAdding \/ Deleting\r\n-----------------\r\n\r\ngit add &lt;file1&gt; &lt;file2&gt; ...\r\n  add &lt;file1&gt;, &lt;file2&gt;, etc... to the project\r\n\r\ngit add &lt;dir&gt;\r\n  add all files under directory &lt;dir&gt; to the project, including subdirectories\r\n\r\ngit add .\r\n  add all files under the current directory to the project\r\n  *WARNING*: including untracked files.\r\n\r\ngit rm &lt;file1&gt; &lt;file2&gt; ...\r\n  remove &lt;file1&gt;, &lt;file2&gt;, etc... from the project\r\n\r\ngit rm $(git ls-files --deleted)\r\n  remove all deleted files from the project\r\n\r\ngit rm --cached &lt;file1&gt; &lt;file2&gt; ...\r\n  commits absence of &lt;file1&gt;, &lt;file2&gt;, etc... from the project\r\n\r\nIgnoring\r\n---------\r\n\r\nOption 1:\r\n\r\nEdit $GIT_DIR\/info\/exclude. See Environment Variables below for explanation on\r\n$GIT_DIR.\r\n\r\nOption 2:\r\n\r\nAdd a file .gitignore to the root of your project. This file will be checked in.\r\n\r\nEither way you need to add patterns to exclude to these files.\r\n\r\nStaging\r\n-------\r\n\r\ngit add &lt;file1&gt; &lt;file2&gt; ...\r\ngit stage &lt;file1&gt; &lt;file2&gt; ...\r\n  add changes in &lt;file1&gt;, &lt;file2&gt; ... to the staging area (to be included in\r\n  the next commit\r\n\r\ngit add -p\r\ngit stage --patch\r\n  interactively walk through the current changes (hunks) in the working\r\n  tree, and decide which changes to add to the staging area.\r\n\r\ngit add -i\r\ngit stage --interactive\r\n  interactively add files\/changes to the staging area. For a simpler\r\n  mode (no menu), try `git add --patch` (above)\r\n\r\nUnstaging\r\n---------\r\n\r\ngit reset HEAD &lt;file1&gt; &lt;file2&gt; ...\r\n  remove the specified files from the next commit\r\n\r\n\r\nCommitting\r\n----------\r\n\r\ngit commit &lt;file1&gt; &lt;file2&gt; ... [-m &lt;msg&gt;]\r\n  commit &lt;file1&gt;, &lt;file2&gt;, etc..., optionally using commit message &lt;msg&gt;,\r\n  otherwise opening your editor to let you type a commit message\r\n\r\ngit commit -a\r\n  commit all files changed since your last commit\r\n  (does not include new (untracked) files)\r\n\r\ngit commit -v\r\n  commit verbosely, i.e. includes the diff of the contents being committed in\r\n  the commit message screen\r\n\r\ngit commit --amend\r\n  edit the commit message of the most recent commit\r\n\r\ngit commit --amend &lt;file1&gt; &lt;file2&gt; ...\r\n  redo previous commit, including changes made to &lt;file1&gt;, &lt;file2&gt;, etc...\r\n\r\n\r\nBranching\r\n---------\r\n\r\ngit branch\r\n  list all local branches\r\n\r\ngit branch -r\r\n  list all remote branches\r\n\r\ngit branch -a\r\n  list all local and remote branches\r\n\r\ngit branch &lt;branch&gt;\r\n  create a new branch named &lt;branch&gt;, referencing the same point in history as\r\n  the current branch\r\n\r\ngit branch &lt;branch&gt; &lt;start-point&gt;\r\n  create a new branch named &lt;branch&gt;, referencing &lt;start-point&gt;, which may be\r\n  specified any way you like, including using a branch name or a tag name\r\n\r\ngit push &lt;repo&gt; &lt;start-point&gt;:refs\/heads\/&lt;branch&gt;\r\n  create a new remote branch named &lt;branch&gt;, referencing &lt;start-point&gt; on the\r\n  remote. Repo is the name of the remote.\r\n  Example: git push origin origin:refs\/heads\/branch-1\r\n  Example: git push origin origin\/branch-1:refs\/heads\/branch-2\r\n  Example: git push origin branch-1 ## shortcut\r\n\r\ngit branch --track &lt;branch&gt; &lt;remote-branch&gt;\r\n  create a tracking branch. Will push\/pull changes to\/from another repository.\r\n  Example: git branch --track experimental origin\/experimental\r\n\r\ngit branch --set-upstream &lt;branch&gt; &lt;remote-branch&gt; (As of Git 1.7.0)\r\n  Make an existing branch track a remote branch\r\n  Example: git branch --set-upstream foo origin\/foo\r\n\r\ngit branch -d &lt;branch&gt;\r\n  delete the branch &lt;branch&gt;; if the branch you are deleting points to a\r\n  commit which is not reachable from the current branch, this command\r\n  will fail with a warning.\r\n\r\ngit branch -r -d &lt;remote-branch&gt;\r\n  delete a remote-tracking branch.\r\n  Example: git branch -r -d wycats\/master\r\n\r\ngit branch -D &lt;branch&gt;\r\n  even if the branch points to a commit not reachable from the current branch,\r\n  you may know that that commit is still reachable from some other branch or\r\n  tag. In that case it is safe to use this command to force git to delete the\r\n  branch.\r\n\r\ngit checkout &lt;branch&gt;\r\n  make the current branch &lt;branch&gt;, updating the working directory to reflect\r\n  the version referenced by &lt;branch&gt;\r\n\r\ngit checkout -b &lt;new&gt; &lt;start-point&gt;\r\n  create a new branch &lt;new&gt; referencing &lt;start-point&gt;, and check it out.\r\n\r\ngit push &lt;repository&gt; :&lt;branch&gt;\r\n  removes a branch from a remote repository.\r\n  Example: git push origin :old_branch_to_be_deleted\r\n\r\ngit co &lt;branch&gt; &lt;path to new file&gt;\r\n  Checkout a file from another branch and add it to this branch. File\r\n  will still need to be added to the git branch, but it's present.\r\n  Eg. git co remote_at_origin__tick702_antifraud_blocking\r\n  ....\/...nt_elements_for_iframe_blocked_page.rb\r\n\r\ngit show &lt;branch&gt; -- &lt;path to file that does not exist&gt;\r\n  Eg. git show remote_tick702 -- path\/to\/fubar.txt\r\n  show the contents of a file that was created on another branch and that\r\n  does not exist on the current branch.\r\n\r\ngit show &lt;rev&gt;:&lt;repo path to file&gt;\r\n  Show the contents of a file at the specific revision. Note: path has to be\r\n  absolute within the repo.\r\n\r\nMerging\r\n-------\r\n\r\ngit merge &lt;branch&gt;\r\n  merge branch &lt;branch&gt; into the current branch; this command is idempotent\r\n  and can be run as many times as needed to keep the current branch\r\n  up-to-date with changes in &lt;branch&gt;\r\n\r\ngit merge &lt;branch&gt; --no-commit\r\n  merge branch &lt;branch&gt; into the current branch, but do not autocommit the\r\n  result; allows you to make further tweaks\r\n\r\ngit merge &lt;branch&gt; -s ours\r\n  merge branch &lt;branch&gt; into the current branch, but drops any changes in\r\n  &lt;branch&gt;, using the current tree as the new tree\r\n\r\n\r\nCherry-Picking\r\n--------------\r\n\r\ngit cherry-pick [--edit] [-n] [-m parent-number] [-s] [-x] &lt;commit&gt;\r\n  selectively merge a single commit from another local branch\r\n  Example: git cherry-pick 7300a6130d9447e18a931e898b64eefedea19544\r\n\r\n\r\nSquashing\r\n---------\r\nWARNING: \"git rebase\" changes history. Be careful. Google it.\r\n\r\ngit rebase --interactive HEAD~10\r\n  (then change all but the first \"pick\" to \"squash\")\r\n  squash the last 10 commits into one big commit\r\n\r\n\r\nConflicts\r\n---------\r\n\r\ngit mergetool\r\n  work through conflicted files by opening them in your mergetool (opendiff,\r\n  kdiff3, etc.) and choosing left\/right chunks. The merged result is staged for\r\n  commit.\r\n\r\nFor binary files or if mergetool won't do, resolve the conflict(s) manually\r\nand then do:\r\n\r\n  git add &lt;file1&gt; [&lt;file2&gt; ...]\r\n\r\nOnce all conflicts are resolved and staged, commit the pending merge with:\r\n\r\n  git commit\r\n\r\n\r\nSharing\r\n-------\r\n\r\ngit fetch &lt;remote&gt;\r\n  update the remote-tracking branches for &lt;remote&gt; (defaults to \"origin\").\r\n  Does not initiate a merge into the current branch (see \"git pull\" below).\r\n\r\ngit pull\r\n  fetch changes from the server, and merge them into the current branch.\r\n  Note: .git\/config must have a [branch \"some_name\"] section for the current\r\n  branch, to know which remote-tracking branch to merge into the current\r\n  branch.  Git 1.5.3 and above adds this automatically.\r\n\r\ngit push\r\n  update the server with your commits across all branches that are *COMMON*\r\n  between your local copy and the server.  Local branches that were never\r\n  pushed to the server in the first place are not shared.\r\n\r\ngit push origin &lt;branch&gt;\r\n  update the server with your commits made to &lt;branch&gt; since your last push.\r\n  This is always *required* for new branches that you wish to share. After\r\n  the first explicit push, \"git push\" by itself is sufficient.\r\n\r\ngit push origin &lt;branch&gt;:refs\/heads\/&lt;branch&gt;\r\n  E.g. git push origin twitter-experiment:refs\/heads\/twitter-experiment\r\n  Which, in fact, is the same as git push origin &lt;branch&gt; but a little\r\n  more obvious what is happening.\r\n\r\nReverting\r\n---------\r\n\r\ngit revert &lt;rev&gt;\r\n  reverse commit specified by &lt;rev&gt; and commit the result.  This does *not* do\r\n  the same thing as similarly named commands in other VCS's such as \"svn\r\n  revert\" or \"bzr revert\", see below\r\n\r\ngit checkout &lt;file&gt;\r\n  re-checkout &lt;file&gt;, overwriting any local changes\r\n\r\ngit checkout .\r\n  re-checkout all files, overwriting any local changes.  This is most similar\r\n  to \"svn revert\" if you're used to Subversion commands\r\n\r\n\r\nFix mistakes \/ Undo\r\n-------------------\r\n\r\ngit reset --hard\r\n  abandon everything since your last commit; this command can be DANGEROUS.\r\n  If merging has resulted in conflicts and you'd like to just forget about\r\n  the merge, this command will do that.\r\n\r\ngit reset --hard ORIG_HEAD or git reset --hard origin\/master \r\n  undo your most recent *successful* merge *and* any changes that occurred\r\n  after.  Useful for forgetting about the merge you just did.  If there are\r\n  conflicts (the merge was not successful), use \"git reset --hard\" (above)\r\n  instead.\r\n\r\ngit reset --soft HEAD^\r\n  forgot something in your last commit? That's easy to fix. Undo your last\r\n  commit, but keep the changes in the staging area for editing.\r\n\r\ngit commit --amend\r\n  redo previous commit, including changes you've staged in the meantime.\r\n  Also used to edit commit message of previous commit.\r\n\r\n\r\nPlumbing\r\n--------\r\n\r\ntest &lt;sha1-A&gt; = $(git merge-base &lt;sha1-A&gt; &lt;sha1-B&gt;)\r\n  determine if merging sha1-B into sha1-A is achievable as a fast forward;\r\n  non-zero exit status is false.\r\n\r\n\r\nStashing\r\n--------\r\n\r\ngit stash\r\ngit stash save &lt;optional-name&gt;\r\n  save your local modifications to a new stash (so you can for example\r\n  \"git svn rebase\" or \"git pull\")\r\n\r\ngit stash apply\r\n  restore the changes recorded in the stash on top of the current working tree\r\n  state\r\n\r\ngit stash pop\r\n  restore the changes from the most recent stash, and remove it from the stack\r\n  of stashed changes\r\n\r\ngit stash list\r\n  list all current stashes\r\n\r\ngit stash show &lt;stash-name&gt; -p\r\n  show the contents of a stash - accepts all diff args\r\n\r\ngit stash drop [&lt;stash-name&gt;]\r\n  delete the stash\r\n\r\ngit stash clear\r\n  delete all current stashes\r\n\r\n\r\nRemotes\r\n-------\r\n\r\ngit remote add &lt;remote&gt; &lt;remote_URL&gt;\r\n  adds a remote repository to your git config.  Can be then fetched locally.\r\n  Example:\r\n    git remote add coreteam git:\/\/github.com\/wycats\/merb-plugins.git\r\n    git fetch coreteam\r\n\r\ngit push &lt;remote&gt; :refs\/heads\/&lt;branch&gt;\r\n  delete a branch in a remote repository\r\n\r\ngit push &lt;remote&gt; &lt;remote&gt;:refs\/heads\/&lt;remote_branch&gt;\r\n  create a branch on a remote repository\r\n  Example: git push origin origin:refs\/heads\/new_feature_name\r\n\r\ngit push &lt;repository&gt; +&lt;remote&gt;:&lt;new_remote&gt;\r\n  replace a &lt;remote&gt; branch with &lt;new_remote&gt;\r\n  think twice before do this\r\n  Example: git push origin +master:my_branch\r\n\r\ngit remote prune &lt;remote&gt;\r\n  prune deleted remote-tracking branches from \"git branch -r\" listing\r\n\r\ngit remote add -t master -m master origin git:\/\/example.com\/git.git\/\r\n  add a remote and track its master\r\n\r\ngit remote show &lt;remote&gt;\r\n  show information about the remote server.\r\n\r\ngit checkout -b &lt;local branch&gt; &lt;remote&gt;\/&lt;remote branch&gt;\r\n  Eg git checkout -b myfeature origin\/myfeature\r\n  Track a remote branch as a local branch.\r\n\r\ngit pull &lt;remote&gt; &lt;branch&gt;\r\ngit push\r\n  For branches that are remotely tracked (via git push) but\r\n  that complain about non-fast forward commits when doing a\r\n  git push. The pull synchronizes local and remote, and if\r\n  all goes well, the result is pushable.\r\n\r\ngit fetch &lt;remote&gt;\r\n  Retrieves all branches from the remote repository. After\r\n  this 'git branch --track ...' can be used to track a branch\r\n  from the new remote.\r\n\r\nSubmodules\r\n----------\r\n\r\ngit submodule add &lt;remote_repository&gt; &lt;path\/to\/submodule&gt;\r\n  add the given repository at the given path. The addition will be part of the\r\n  next commit.\r\n\r\ngit submodule update [--init]\r\n  Update the registered submodules (clone missing submodules, and checkout\r\n  the commit specified by the super-repo). --init is needed the first time.\r\n\r\ngit submodule foreach &lt;command&gt;\r\n  Executes the given command within each checked out submodule.\r\n\r\nRemoving submodules\r\n\r\n   1. Delete the relevant line from the .gitmodules file.\r\n   2. Delete the relevant section from .git\/config.\r\n   3. Run git rm --cached path_to_submodule (no trailing slash).\r\n   4. Commit and delete the now untracked submodule files.\r\n\r\nUpdating submodules\r\n  To update a submodule to a new commit:\r\n    1. update submodule:\r\n        cd &lt;path to submodule&gt;\r\n        git pull\r\n    2. commit the new version of submodule:\r\n        cd &lt;path to toplevel&gt;\r\n        git commit -m \"update submodule version\"\r\n    3. check that the submodule has the correct version\r\n        git submodule status\r\n  If the update in the submodule is not committed in the\r\n  main repository, it is lost and doing git submodule\r\n  update will revert to the previous version.\r\n\r\nPatches\r\n-------\r\n\r\ngit format-patch HEAD^\r\n  Generate the last commit as a patch that can be applied on another\r\n  clone (or branch) using 'git am'. Format patch can also generate a\r\n  patch for all commits using 'git format-patch HEAD^ HEAD'\r\n  All page files will be enumerated with a prefix, e.g. 0001 is the\r\n  first patch.\r\n\r\ngit format-patch &lt;Revision&gt;^..&lt;Revision&gt;\r\n  Generate a patch for a single commit. E.g.\r\n    git format-patch d8efce43099^..d8efce43099\r\n  Revision does not need to be fully specified.\r\n\r\ngit am &lt;patch file&gt;\r\n  Applies the patch file generated by format-patch.\r\n\r\ngit diff --no-prefix &gt; patchfile\r\n  Generates a patch file that can be applied using patch:\r\n    patch -p0 &lt; patchfile\r\n  Useful for sharing changes without generating a git commit.\r\n\r\nTags\r\n----\r\n\r\ngit tag -l\r\n  Will list all tags defined in the repository.\r\n\r\ngit co &lt;tag_name&gt;\r\n  Will checkout the code for a particular tag. After this you'll\r\n  probably want to do: 'git co -b &lt;some branch name&gt;' to define\r\n  a branch. Any changes you now make can be committed to that\r\n  branch and later merged.\r\n\r\nArchive\r\n-------\r\n\r\ngit archive master | tar -x -C \/somewhere\/else\r\n  Will export expanded tree as tar archive at given path\r\n\r\ngit archive master | bzip2 &gt; source-tree.tar.bz2\r\n  Will export archive as bz2\r\n\r\ngit archive --format zip --output \/full\/path master\r\n  Will export as zip\r\n\r\nGit Instaweb\r\n------------\r\n\r\ngit instaweb --httpd=webrick [--start | --stop | --restart]\r\n\r\n\r\nEnvironment Variables\r\n---------------------\r\n\r\nGIT_AUTHOR_NAME, GIT_COMMITTER_NAME\r\n  Your full name to be recorded in any newly created commits.  Overrides\r\n  user.name in .git\/config\r\n\r\nGIT_AUTHOR_EMAIL, GIT_COMMITTER_EMAIL\r\n  Your email address to be recorded in any newly created commits.  Overrides\r\n  user.email in .git\/config\r\n\r\nGIT_DIR\r\n  Location of the repository to use (for out of working directory repositories)\r\n\r\nGIT_WORKING_TREE\r\n  Location of the Working Directory - use with GIT_DIR to specifiy the working\r\n  directory root\r\n  or to work without being in the working directory at all.\r\n\r\nref: http:\/\/pegmanm.tumblr.com\/post\/13722249878\/git-cheat-sheet<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Git Cheat Sheet Setup &#8212;&#8211; git clone &lt;repo&gt; clone the repository specified by &lt;repo&gt;; this&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html\">Read the post<span class=\"screen-reader-text\">Git Cheat Sheet<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":2074,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[11],"tags":[48,267],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git Cheat Sheet - EngineerBALL<\/title>\n<meta name=\"description\" content=\"Git command for everyone\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Cheat Sheet - EngineerBALL\" \/>\n<meta property=\"og:url\" content=\"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html\" \/>\n<meta property=\"og:site_name\" content=\"EngineerBALL\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/engineerball\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/troueblemaker.khunpech?ref=tn_tnmn\" \/>\n<meta property=\"article:published_time\" content=\"2014-11-21T01:12:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-21T01:15:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/engineerball.com\/wp-content\/uploads\/2014\/11\/poptocat_v2.png\" \/>\n<meta name=\"author\" content=\"ball\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@engineerball\" \/>\n<meta name=\"twitter:site\" content=\"@engineerball\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ball\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html\",\"url\":\"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html\",\"name\":\"Git Cheat Sheet - EngineerBALL\",\"isPartOf\":{\"@id\":\"https:\/\/engineerball.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html#primaryimage\"},\"image\":{\"@id\":\"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html#primaryimage\"},\"thumbnailUrl\":\"https:\/\/engineerball.com\/blog\/wp-content\/uploads\/2014\/11\/poptocat_v2.png\",\"datePublished\":\"2014-11-21T01:12:12+00:00\",\"dateModified\":\"2014-11-21T01:15:04+00:00\",\"author\":{\"@id\":\"https:\/\/engineerball.com\/blog\/#\/schema\/person\/415320d0da2d392375528001aa6ea53e\"},\"description\":\"Git command for everyone\",\"breadcrumb\":{\"@id\":\"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html#primaryimage\",\"url\":\"https:\/\/engineerball.com\/blog\/wp-content\/uploads\/2014\/11\/poptocat_v2.png\",\"contentUrl\":\"https:\/\/engineerball.com\/blog\/wp-content\/uploads\/2014\/11\/poptocat_v2.png\",\"width\":896,\"height\":896},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/engineerball.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git Cheat Sheet\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/engineerball.com\/blog\/#website\",\"url\":\"https:\/\/engineerball.com\/blog\/\",\"name\":\"EngineerBALL\",\"description\":\"Damn Those Sweet Memories\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/engineerball.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/engineerball.com\/blog\/#\/schema\/person\/415320d0da2d392375528001aa6ea53e\",\"name\":\"ball\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/engineerball.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d8d00c01f55942d7c8f2dbc70a9cefe0?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d8d00c01f55942d7c8f2dbc70a9cefe0?s=96&d=monsterid&r=g\",\"caption\":\"ball\"},\"description\":\"Teerapat Khunpech Live, Tech, Beers, Bike, Cafe Racer, Docker, Devops, Eco-System\",\"sameAs\":[\"https:\/\/engineerball.com\",\"https:\/\/www.facebook.com\/troueblemaker.khunpech?ref=tn_tnmn\",\"https:\/\/twitter.com\/engineerball\"],\"url\":\"https:\/\/engineerball.com\/blog\/author\/ball\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git Cheat Sheet - EngineerBALL","description":"Git command for everyone","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html","og_locale":"en_US","og_type":"article","og_title":"Git Cheat Sheet - EngineerBALL","og_url":"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html","og_site_name":"EngineerBALL","article_publisher":"https:\/\/www.facebook.com\/engineerball","article_author":"https:\/\/www.facebook.com\/troueblemaker.khunpech?ref=tn_tnmn","article_published_time":"2014-11-21T01:12:12+00:00","article_modified_time":"2014-11-21T01:15:04+00:00","og_image":[{"url":"https:\/\/engineerball.com\/wp-content\/uploads\/2014\/11\/poptocat_v2.png"}],"author":"ball","twitter_card":"summary_large_image","twitter_creator":"@engineerball","twitter_site":"@engineerball","twitter_misc":{"Written by":"ball","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html","url":"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html","name":"Git Cheat Sheet - EngineerBALL","isPartOf":{"@id":"https:\/\/engineerball.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html#primaryimage"},"image":{"@id":"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html#primaryimage"},"thumbnailUrl":"https:\/\/engineerball.com\/blog\/wp-content\/uploads\/2014\/11\/poptocat_v2.png","datePublished":"2014-11-21T01:12:12+00:00","dateModified":"2014-11-21T01:15:04+00:00","author":{"@id":"https:\/\/engineerball.com\/blog\/#\/schema\/person\/415320d0da2d392375528001aa6ea53e"},"description":"Git command for everyone","breadcrumb":{"@id":"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html#primaryimage","url":"https:\/\/engineerball.com\/blog\/wp-content\/uploads\/2014\/11\/poptocat_v2.png","contentUrl":"https:\/\/engineerball.com\/blog\/wp-content\/uploads\/2014\/11\/poptocat_v2.png","width":896,"height":896},{"@type":"BreadcrumbList","@id":"https:\/\/engineerball.com\/blog\/2014\/11\/21\/git-cheat-sheet.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/engineerball.com\/blog"},{"@type":"ListItem","position":2,"name":"Git Cheat Sheet"}]},{"@type":"WebSite","@id":"https:\/\/engineerball.com\/blog\/#website","url":"https:\/\/engineerball.com\/blog\/","name":"EngineerBALL","description":"Damn Those Sweet Memories","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/engineerball.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/engineerball.com\/blog\/#\/schema\/person\/415320d0da2d392375528001aa6ea53e","name":"ball","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/engineerball.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d8d00c01f55942d7c8f2dbc70a9cefe0?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d8d00c01f55942d7c8f2dbc70a9cefe0?s=96&d=monsterid&r=g","caption":"ball"},"description":"Teerapat Khunpech Live, Tech, Beers, Bike, Cafe Racer, Docker, Devops, Eco-System","sameAs":["https:\/\/engineerball.com","https:\/\/www.facebook.com\/troueblemaker.khunpech?ref=tn_tnmn","https:\/\/twitter.com\/engineerball"],"url":"https:\/\/engineerball.com\/blog\/author\/ball"}]}},"jetpack_featured_media_url":"https:\/\/engineerball.com\/blog\/wp-content\/uploads\/2014\/11\/poptocat_v2.png","jetpack_shortlink":"https:\/\/wp.me\/p3Nmbl-xr","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/engineerball.com\/blog\/wp-json\/wp\/v2\/posts\/2073"}],"collection":[{"href":"https:\/\/engineerball.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/engineerball.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/engineerball.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/engineerball.com\/blog\/wp-json\/wp\/v2\/comments?post=2073"}],"version-history":[{"count":0,"href":"https:\/\/engineerball.com\/blog\/wp-json\/wp\/v2\/posts\/2073\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/engineerball.com\/blog\/wp-json\/wp\/v2\/media\/2074"}],"wp:attachment":[{"href":"https:\/\/engineerball.com\/blog\/wp-json\/wp\/v2\/media?parent=2073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/engineerball.com\/blog\/wp-json\/wp\/v2\/categories?post=2073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/engineerball.com\/blog\/wp-json\/wp\/v2\/tags?post=2073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}