From: Ulf Jasper <ulf.jasper@web.de>
To: Bill Wohler <wohler@newt.com>
Cc: emacs-devel@gnu.org
Subject: Re: Cluttering the git tree
Date: Thu, 20 Nov 2014 18:42:05 +0100 [thread overview]
Message-ID: <87k32pzs42.fsf@web.de> (raw)
In-Reply-To: 87r3wyzcor.fsf@olgas.newt.com
Bill Wohler <wohler@newt.com> writes:
> Ulf Jasper <ulf.jasper@web.de> writes:
>
>> I just noticed that I cluttered the git tree with my last commit. All
>> my intermediate commits which were supposed to be visible only to me
>> suddenly appeared in the public repository. Sorry!
>
> Another idea is to put your intermediate commits into a new branch and
> then merge them into master with git merge --squash.
That is, what I was looking for. Thank you, Bill!
This is how I (will) work: I am not changing files on the master branch
but on a temporary branch, while keeping the master branch synced with
the public repository, like so:
a - b - c - d master
\
x - y - z temporary
I am doing commits on the temporary branch so that I can easily switch
branches. Once I have finished working on the temporary thing I merge
the *results* of that work into the master branch
git checkout master
git merge --squash temporary
The magic '--squash' guarantees that there will not be any intermediate
commits. After resolving merge conflicts it looks as if I had made the
temporary changes directly on the master branch. After committing the
changed files (with its own commit message) I get
a - b - c - d - e master
\
x - y - z temporary
where 'e' now contains all the changes of 'z'. Now I'm ready to push
'e' to the public repository and delete the temporary branch (with
'-D'). There is just one commit -- nobody will be bothered with any
intermediate commits. Voila!
Ulf
P.S. I have tried this on a local repository and verified that it
works. I am quite confident that it will work on the official
repository as well. But I may be wrong. We'll see. ;)
next prev parent reply other threads:[~2014-11-20 17:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-17 20:51 Cluttering the git tree Ulf Jasper
2014-11-17 22:36 ` David Kastrup
2014-11-17 22:53 ` Lars Magne Ingebrigtsen
2014-11-17 23:14 ` Andreas Schwab
2014-11-20 6:18 ` Rob Browning
2014-11-20 5:03 ` Bill Wohler
2014-11-20 17:42 ` Ulf Jasper [this message]
2014-11-20 18:27 ` Achim Gratz
2014-11-20 19:01 ` Ulf Jasper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k32pzs42.fsf@web.de \
--to=ulf.jasper@web.de \
--cc=emacs-devel@gnu.org \
--cc=wohler@newt.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.