gawkworkflow: Cheat Sheet
1
1 Appendix A Git Command Cheat Sheet
1 **********************************
1
1 This major node provides an alphabetical list of the Git commands cited
1 in this Info file, along with brief descriptions of what the commands
1 do.
1
1 Note that you may always use either 'git help COMMAND' or 'git
1 COMMAND --help' to get short, man-page style help on how to use any
1 given Git command.
1
1 'git add'
1 Add a file to the list of files to be committed.
1
1 'git branch'
1 View existing branches, or delete a branch. Most useful options:
1 '-a' and '-d'.
1
1 'git checkout'
1 Checkout an existing branch, create a new branch, or checkout a
1 file to reset it. Use the '-b' option to create and checkout a new
1 branch in one operation.
1
1 'git clone'
1 Clone (make a new copy of) an existing repository. You generally
1 only need to do this once.
1
1 'git commit'
1 Commit changes to files which have been staged for committing with
1 'git add'. This makes your changes permanent, _in your local
1 repository only_. To publish your changes to an upstream repo, you
1 must use 'git push'.
1
1 'git config'
1 Display and/or change global and/or local configuration settings.
1
1 'git diff'
1 Show a unified-format diff of what's changed in the current
1 directory as of the last commit. It helps to have Git configured
11 to use its builtin pager for reviewing diffs (⇒Configuring
git).
1
1 'git difftool'
1 Use a "tool" (usually a GUI-based program) to view differences,
1 instead of the standard textual diff as you'd get from 'git diff'.
1
1 'git fetch'
1 Update your local copy of the upstream's branches. That is, update
1 the various 'origin/' branches. This leaves your local tracking
1 branches unchanged. With the '--prune' option, this removes any
1 copies of stale 'origin/' branches.
1
1 'git format-patch'
1 Create a series of patch files, one per commit not on the original
1 branch from which you started.
1
1 'git gc'
1 Run a "garbage collection" pass in the current repository. This
1 can often reduce the space used in a large repo. For 'gawk' it
1 does not make that much difference.
1
1 'git help'
1 Print a man-page-style usage summary for a command.
1
1 'git log'
1 Show the current branch's commit log. This includes who made the
1 commit, the date, and the commit message. Commits are shown from
1 newest to oldest.
1
1 'git merge'
1 Merge changes from the named branch into the current one.
1
1 'git pull'
1 When in your local tracking branch 'XXX', run 'git fetch', and then
1 merge from 'origin/XXX' into 'XXX'.
1
1 'git push'
1 Push commits from your local tracking branch 'XXX' through
1 'origin/XXX' and on to branch 'XXX' in the upstream repo. Use 'git
1 push -u origin --delete XXX' to delete an upstream branch. (Do so
1 carefully!)
1
1 'git rebase'
1 Rebase the changes in the current purely local branch to look as if
1 they had been made relative to the latest commit in the current
1 upstream branch (typically 'master'). This is how you keep your
1 local, in-progress changes up-to-date with respect to the original
1 branch from which they were started.
1
1 'git reset'
1 Restore the original state of the repo, especially with the
1 '--hard' option. Read up on this command, and use it carefully.
1
1 'git status'
1 Show the status of files that are scheduled to be committed, and
1 those that have been modified but not yet scheduled for committing.
1 Use 'git add' to schedule a file for committing. This command also
1 lists untracked files.
1