A variable may be assigned to by a statement of the form
If value is not given, the variable is assigned the null string. All values undergo tilde expansion,
parameter and variable expansion, command substitution, arithmetic expansion, and quote removal (see
EXPANSION below). If the variable has its integer attribute set, then value is evaluated as an
arithmetic expression even if the $((...)) expansion is not used (see Arithmetic Expansion below). Word
splitting is not performed, with the exception of "$@" as explained below under Special Parameters.
Pathname expansion is not performed. Assignment statements may also appear as arguments to the alias,
declare, typeset, export, readonly, and local builtin commands.
In the context where an assignment statement is assigning a value to a shell variable or array index, the
+= operator can be used to append to or add to the variable's previous value. When += is applied to a
variable for which the integer attribute has been set, value is evaluated as an arithmetic expression and
added to the variable's current value, which is also evaluated. When += is applied to an array variable
using compound assignment (see Arrays below), the variable's value is not unset (as it is when using =),
and new values are appended to the array beginning at one greater than the array's maximum index (for
indexed arrays) or added as additional key-value pairs in an associative array. When applied to a
string-valued variable, value is expanded and appended to the variable's value.
Used to amend the tip of the current branch. Prepare the tree object you would want to replace the
latest commit as usual (this includes the usual -i/-o and explicit paths), and the commit log editor
is seeded with the commit message from the tip of the current branch. The commit you create replaces
the current tip — if it was a merge, it will have the parents of the current tip as parents — so the
current top commit is discarded.
It is a rough equivalent for:
$ git reset --soft HEAD^
$ ... do something else to come up with the right tree ...
$ git commit -c ORIG_HEAD
but can be used to amend a merge commit.
You should understand the implications of rewriting history if you amend a commit that has already
been published. (See the "RECOVERING FROM UPSTREAM REBASE" section in git-rebase(1).)