git/Documentation
Junio C Hamano 7d0c68871a git-merge --squash
Some people tend to do many little commits on a topic branch,
recording all the trials and errors, and when the topic is
reasonably cooked well, would want to record the net effect of
the series as one commit on top of the mainline, removing the
cruft from the history.  The topic is then abandoned or forked
off again from that point at the mainline.

The barebone porcelainish that comes with core git tools does
not officially support such operation, but you can fake it by
using "git pull --no-merge" when such a topic branch is not a
strict superset of the mainline, like this:

	git checkout mainline
	git pull --no-commit . that-topic-branch
	: fix conflicts if any
	rm -f .git/MERGE_HEAD
        git commit -a -m 'consolidated commit log message'
	git branch -f that-topic-branch ;# now fully merged

This however does not work when the topic branch is a fast
forward of the mainline, because normal "git pull" will never
create a merge commit in such a case, and there is nothing
special --no-commit could do to begin with.

This patch introduces a new option, --squash, to support such a
workflow officially in both fast-forward case and true merge
case.  The user-level operation would be the same in both cases:

	git checkout mainline
        git pull --squash . that-topic-branch
        : fix conflicts if any -- naturally, there would be
        : no conflict if fast forward.
	git commit -a -m  'consolidated commit log message'
	git branch -f that-topic-branch ;# now fully merged

When the current branch is already up-to-date with respect to
the other branch, there truly is nothing to do, so the new
option does not have any effect.

This was brought up in #git IRC channel recently.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-24 01:11:19 -07:00
..
howto Add howto about separating topics. 2006-02-12 05:02:42 -08:00
technical Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
.gitignore Don't include ../README in git.txt - make a local copy 2006-01-24 23:16:31 -08:00
asciidoc.conf Tweak asciidoc output to work with broken docbook-xsl 2006-03-05 22:38:12 -08:00
build-docdep.perl Clean build annoyance. 2005-11-08 08:58:52 -08:00
callouts.xsl Properly render asciidoc "callouts" in git man pages. 2006-04-28 14:31:51 -07:00
config.txt Documentation: git aliases 2006-06-07 17:25:21 -07:00
core-tutorial.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
cvs-migration.txt Some doc typo fixes 2006-06-07 11:49:35 -07:00
diff-format.txt Documentation: diff -c/--cc 2006-01-28 02:26:30 -08:00
diff-options.txt Add "--summary" option to git diff. 2006-05-14 16:28:45 -07:00
diffcore.txt Fix recent documentation format breakage. 2005-10-29 00:50:42 -07:00
everyday.txt Some doc typo fixes 2006-06-07 11:49:35 -07:00
fetch-options.txt git-fetch --upload-pack: disambiguate. 2006-01-26 18:11:06 -08:00
git-add.txt Document that "git add" only adds non-ignored files. 2006-05-20 18:22:11 -07:00
git-am.txt war on whitespaces: documentation. 2006-03-02 00:52:59 -08:00
git-annotate.txt Add git-annotate(1) and git-blame(1) 2006-04-18 12:06:55 -07:00
git-apply.txt Misc doc improvements 2006-06-07 12:37:46 -07:00
git-applymbox.txt Brief documentation for the mysterious git-am script 2005-10-20 22:32:07 -07:00
git-applypatch.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-archimport.txt git/Documentation: fix SYNOPSIS style bugs 2006-03-05 17:02:02 -08:00
git-bisect.txt Documentation: talk about pathspec in bisect. 2005-12-05 00:15:24 -08:00
git-blame.txt blame: Add --time to produce raw timestamps 2006-06-16 22:45:11 -07:00
git-branch.txt Merge branch 'master' into sp/reflog 2006-05-24 16:49:24 -07:00
git-cat-file.txt cat-file: document -p option 2006-05-24 22:29:23 -07:00
git-check-ref-format.txt Some doc typo fixes 2006-06-07 11:49:35 -07:00
git-checkout-index.txt Fix up docs where "--" isn't displayed correctly. 2006-05-05 14:21:52 -07:00
git-checkout.txt Merge branch 'master' into sp/reflog 2006-05-24 16:49:24 -07:00
git-cherry-pick.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-cherry.txt Clarify git-cherry documentation. 2006-05-05 14:23:08 -07:00
git-clean.txt Teach git-clean optional <paths>... parameters. 2006-05-08 16:40:45 -07:00
git-clone.txt Retire git-clone-pack 2006-06-21 02:34:14 -07:00
git-commit-tree.txt trivial: clarify, what are the config's user.name and user.email about 2006-01-05 17:23:21 -08:00
git-commit.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-convert-objects.txt Convert usage of GIT and Git into git 2005-10-10 16:01:31 -07:00
git-count-objects.txt builtin-count-objects: make it official. 2006-05-01 23:06:06 -07:00
git-cvsexportcommit.txt git-cvsexportcommit: Add -f(orce) and -m(essage prefix) flags, small cleanups. 2006-04-26 12:26:16 +12:00
git-cvsimport.txt Fix multi-paragraph list items in OPTIONS section 2006-03-20 14:37:33 -08:00
git-cvsserver.txt git-cvsserver asciidoc formatting tweaks 2006-06-07 16:32:50 -07:00
git-daemon.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-describe.txt Some doc typo fixes 2006-06-07 11:49:35 -07:00
git-diff-files.txt Documentation: diff -c/--cc 2006-01-28 02:26:30 -08:00
git-diff-index.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-diff-stages.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-diff-tree.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-diff.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-fetch-pack.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-fetch.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-fmt-merge-msg.txt Documentation for git-fmt-merge-msg 2005-11-01 14:45:49 -08:00
git-format-patch.txt git-format-patch: add --output-directory long option again 2006-06-06 14:16:43 -07:00
git-fsck-objects.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-get-tar-commit-id.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-grep.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-hash-object.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-http-fetch.txt Wrap synopsis lines and use [verse] to keep formatting 2006-01-05 18:44:28 -08:00
git-http-push.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-imap-send.txt Several trivial documentation touch ups. 2006-05-05 14:21:18 -07:00
git-index-pack.txt Add git-index-pack utility 2005-10-12 18:32:02 -07:00
git-init-db.txt Fix up remaining man pages that use asciidoc "callouts". 2006-04-28 14:31:36 -07:00
git-local-fetch.txt Convert usage of GIT and Git into git 2005-10-10 16:01:31 -07:00
git-log.txt Fix up docs where "--" isn't displayed correctly. 2006-05-05 14:21:52 -07:00
git-lost-found.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-ls-files.txt Documentation: add another example to git-ls-files 2006-06-07 20:19:00 -07:00
git-ls-remote.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-ls-tree.txt Documentation: git-ls-tree (typofix) 2006-06-07 16:29:36 -07:00
git-mailinfo.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-mailsplit.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-merge-base.txt Update the documentation for git-merge-base 2006-05-15 23:19:46 -07:00
git-merge-index.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-merge-one-file.txt Remove the version tags from the manpages 2005-10-10 14:49:52 -07:00
git-merge-tree.txt Documentation: add a couple of missing docs. 2006-04-13 00:21:06 -07:00
git-merge.txt Examples of resetting. 2005-12-16 18:23:33 -08:00
git-mktag.txt Remove the version tags from the manpages 2005-10-10 14:49:52 -07:00
git-mktree.txt Documentation: add a couple of missing docs. 2006-04-13 00:21:06 -07:00
git-mv.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-name-rev.txt Some doc typo fixes 2006-06-07 11:49:35 -07:00
git-p4import.txt Add a "--notags" option for git-p4import. 2006-06-16 22:33:46 -07:00
git-pack-objects.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-pack-redundant.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-parse-remote.txt [PATCH] Documentation: Update all files to use the new gitlink: macro 2005-09-20 15:07:52 -07:00
git-patch-id.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-peek-remote.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-prune-packed.txt cosmetics: change from 'See-Also' to 'See Also' 2006-03-05 00:57:37 -08:00
git-prune.txt Fix up docs where "--" isn't displayed correctly. 2006-05-05 14:21:52 -07:00
git-pull.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-push.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-quiltimport.txt Implement a --dry-run option to git-quiltimport 2006-05-18 22:55:57 -07:00
git-read-tree.txt Merge branch 'jc/rw-prefix' 2006-06-17 17:56:52 -07:00
git-rebase.txt rebase: Allow merge strategies to be used when rebasing 2006-06-21 03:56:29 -07:00
git-receive-pack.txt Retire git-clone-pack 2006-06-21 02:34:14 -07:00
git-relink.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-repack.txt Several trivial documentation touch ups. 2006-05-05 14:21:18 -07:00
git-repo-config.txt Support for extracting configuration from different files 2006-06-18 21:19:07 -07:00
git-request-pull.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-rerere.txt git-rerere: reuse recorded resolve. 2006-02-06 21:53:11 -08:00
git-reset.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-resolve.txt The synopsis of the manpages should use the hyphenated version 2005-10-10 16:01:32 -07:00
git-rev-list.txt Documentation: {caret} fixes (git-rev-list.txt) 2006-05-08 13:46:53 -07:00
git-rev-parse.txt Merge branch 'sp/reflog' 2006-06-03 23:59:03 -07:00
git-revert.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-rm.txt Fix up docs where "--" isn't displayed correctly. 2006-05-05 14:21:52 -07:00
git-send-email.txt Check and document the options to prevent mistakes. 2006-06-22 00:20:20 -07:00
git-send-pack.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-sh-setup.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-shell.txt git/Documentation: fix SYNOPSIS style bugs 2006-03-05 17:02:02 -08:00
git-shortlog.txt Misc doc improvements 2006-06-07 12:37:46 -07:00
git-show-branch.txt Fix minor typo. 2006-03-17 20:42:36 -08:00
git-show-index.txt Convert usage of GIT and Git into git 2005-10-10 16:01:31 -07:00
git-show.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-ssh-fetch.txt Remove the version tags from the manpages 2005-10-10 14:49:52 -07:00
git-ssh-upload.txt Remove the version tags from the manpages 2005-10-10 14:49:52 -07:00
git-status.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-stripspace.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-svnimport.txt Fix multi-paragraph list items in OPTIONS section 2006-03-20 14:37:33 -08:00
git-symbolic-ref.txt Documentation: do not blindly run 'cat' .git/HEAD, or echo into it. 2005-11-15 01:31:04 -08:00
git-tag.txt Fix some inconsistencies in the docs 2006-03-09 11:43:58 -08:00
git-tar-tree.txt git-tar-tree: documentation update 2006-06-18 04:18:25 -07:00
git-tools.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-unpack-file.txt Remove the version tags from the manpages 2005-10-10 14:49:52 -07:00
git-unpack-objects.txt Update git-unpack-objects documentation. 2006-05-05 14:22:32 -07:00
git-update-index.txt Documentation: Spelling fixes 2006-06-03 23:54:55 -07:00
git-update-ref.txt Change order of -m option to update-ref. 2006-05-19 15:03:10 -07:00
git-update-server-info.txt Documentation: HTTP needs update-server-info. 2005-12-17 11:39:39 -08:00
git-upload-pack.txt Retire git-clone-pack 2006-06-21 02:34:14 -07:00
git-upload-tar.txt Documentation: add missing docs make check-docs found. 2006-06-07 11:49:35 -07:00
git-var.txt Deprecate usage of git-var -l for getting config vars list 2006-04-24 22:29:36 -07:00
git-verify-pack.txt Fix up docs where "--" isn't displayed correctly. 2006-05-05 14:21:52 -07:00
git-verify-tag.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-whatchanged.txt Fix up docs where "--" isn't displayed correctly. 2006-05-05 14:21:52 -07:00
git-write-tree.txt write-tree: --prefix=<path> 2006-05-01 22:29:16 -07:00
git.txt Retire git-clone-pack 2006-06-21 02:34:14 -07:00
gitk.txt Fix up docs where "--" isn't displayed correctly. 2006-05-05 14:21:52 -07:00
glossary.txt Misc doc improvements 2006-06-07 12:37:46 -07:00
hooks.txt Some doc typo fixes 2006-06-07 11:49:35 -07:00
howto-index.sh Allow asciidoc formatted documentation in howto/ 2005-08-29 22:38:12 -07:00
install-webdoc.sh Documentation/Makefile: create tarballs for the man pages and html files 2006-05-18 20:15:45 -07:00
Makefile Documentation/Makefile: remove extra / 2006-05-25 22:48:45 -07:00
merge-options.txt git-merge --squash 2006-06-24 01:11:19 -07:00
merge-strategies.txt Documentation: recursive is the default strategy these days. 2005-12-08 14:04:33 -08:00
pull-fetch-param.txt Docs: move git url and remotes text to separate sections 2006-02-06 21:14:56 -08:00
repository-layout.txt Added logs/ directory to repository layout. 2006-05-19 15:02:38 -07:00
sort_glossary.pl Added definitions for a few words: 2006-05-03 22:31:50 -07:00
SubmittingPatches SubmittingPatches: The download location of External Editor has moved 2006-05-18 20:14:28 -07:00
tutorial-2.txt Fix typo in tutorial-2.txt 2006-06-05 13:05:49 -07:00
tutorial.txt Some doc typo fixes 2006-06-07 11:49:35 -07:00
urls.txt Docs: move git url and remotes text to separate sections 2006-02-06 21:14:56 -08:00