From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ulf Jasper Newsgroups: gmane.emacs.devel Subject: Re: Cluttering the git tree Date: Thu, 20 Nov 2014 18:42:05 +0100 Message-ID: <87k32pzs42.fsf@web.de> References: <87h9xx360i.fsf@web.de> <87r3wyzcor.fsf@olgas.newt.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416505386 19587 80.91.229.3 (20 Nov 2014 17:43:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Nov 2014 17:43:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: Bill Wohler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 20 18:42:56 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XrVku-0006gF-48 for ged-emacs-devel@m.gmane.org; Thu, 20 Nov 2014 18:42:56 +0100 Original-Received: from localhost ([::1]:36684 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrVkt-0001RK-Ln for ged-emacs-devel@m.gmane.org; Thu, 20 Nov 2014 12:42:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrVka-0001Qv-KZ for emacs-devel@gnu.org; Thu, 20 Nov 2014 12:42:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrVkU-0006kJ-9Z for emacs-devel@gnu.org; Thu, 20 Nov 2014 12:42:36 -0500 Original-Received: from mout.web.de ([212.227.15.14]:53888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrVkT-0006a6-Vu for emacs-devel@gnu.org; Thu, 20 Nov 2014 12:42:30 -0500 Original-Received: from p55m-ud2 ([217.226.78.93]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MBkKF-1XhIKI3b6t-00AnHf; Thu, 20 Nov 2014 18:42:05 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:6Q+Xg2kSTAWyTwFFBnWSmEH6ejHNyUD0wQGqTIJfzH1vxGji9W/ 79qp9tkendQg2+INA+DgcNKCxsRv24A15tRslTCGsRRpPvidTdclKUoCMQPY8rQeA8+ATaG 7I4UF+964OzOqTRXGv6Stds6Iuu5g8v0E/eYZjWUqKhk5A0zOL8vwkdwcP+8V0HB8w5KG/6 k354++lV8b6uC0CoJHxZg== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.15.14 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:177885 Archived-At: Bill Wohler writes: > Ulf Jasper 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. ;)