Re: git commit --only -- $path when $path already has staged content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stefan Näwe <stefan.naewe@xxxxxxxxxxxxxxxxxxxx> writes:

> The manpage of git commit reads:
>
>   --only
>
>       Make a commit only from the paths specified on the command line,
>       disregarding any contents that have been staged so far. This is
>       the default mode of operation of git commit if any paths are given
>       on the command line, in which case this option can be omitted. [...]

"--only" is as opposed to "--also".  Two modes of partial commits
are:

 - "--also" which updates the index with the whole contents of the
   given paths and record the resulting index as the tree of the new
   commit;

 - "--only" which starts from a new temporary index initialized from
   HEAD with the whole contents of the given paths and record the
   resulting index as the tree of the new commit, and then updates
   the original index with the whole contents of the give paths.

In other words, you give paths from the command line to tell the
command that you want to record the contents of them in the working
tree as a whole to be recorded in the resulting commit.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]