From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: best workflow with git ? Date: Sat, 10 Jun 2017 18:14:16 +0100 Message-ID: <20170610171416.GB95401@breton.holly.idiocy.org> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1497114895 16902 195.159.176.226 (10 Jun 2017 17:14:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 10 Jun 2017 17:14:55 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: emacs-devel To: Jean-Christophe Helary Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 10 19:14:52 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJjyN-0004Ax-Cf for ged-emacs-devel@m.gmane.org; Sat, 10 Jun 2017 19:14:51 +0200 Original-Received: from localhost ([::1]:59205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJjyS-0003sq-Pg for ged-emacs-devel@m.gmane.org; Sat, 10 Jun 2017 13:14:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJjxk-0003rk-Ne for emacs-devel@gnu.org; Sat, 10 Jun 2017 13:14:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJjxj-0005XZ-Nk for emacs-devel@gnu.org; Sat, 10 Jun 2017 13:14:12 -0400 Original-Received: from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]:35408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJjxj-0005XM-GA for emacs-devel@gnu.org; Sat, 10 Jun 2017 13:14:11 -0400 Original-Received: by mail-wr0-x22f.google.com with SMTP id q97so59515901wrb.2 for ; Sat, 10 Jun 2017 10:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=azsSejE9SUPhuI7irvG+6/IawZqyvt2tojKQ5pMI6EY=; b=ThQEjTHNlnYkybF6AT7KT8cHE2WYu+Tmzbc/g07iorROKqR8swpfOgz3j1aSdQxlxw LPK3qNrkYPxqQCqw5BcCPnzHD+Bgsd92rVSnHwDtgShhcFUqxVkr6BWDSlY1Cfeit11/ fAORGDWcYuZVL13ADn1LQhnqSnv0sBEczl5Y+iDjnE1yskZ3nSqPg7/2K2qxqUOtUL0/ f8kBKQynpVNliWSfu75YyFS8eXltU1k/1HXpsJ0IH5Nklvhlxb1UnyQ4q1W4NR+cxU3l rfSV0skRTZKN2C2dESHL1EZgAoXWzw6qT9sRYTtkmcyq7C1qgNRQ2auc63MbPHxkovG9 OFhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=azsSejE9SUPhuI7irvG+6/IawZqyvt2tojKQ5pMI6EY=; b=Oud3BV28g4l16dNZ0GP+i3HpPfP5Dfbcge3mhYI7YF7HHZD4fXkOucK4K5FZlTAvDi u3wVQiJUtgQpTT0NF2caRE0xeV18dkBzQkVUplotfE/28AoTWMercCpmHl8l7IP3O2ho iRcKCEifPupQhZc6eY6u48CqpbogA4X9wF7xsZUH/6kYSnjRR6Qy6QB7luBTIxELxexU kP22TBUPPgteyOp5WGTLxdHEgOV1+RoCIy9eTqaSpyUJw46zDRNuTkSSU86gZTpv3hSI +Cz2vN9L9Y0T7t+kcOBQ9g36LDsgXNYQivgI0xv6trDtQa5CiPD11GAMDYqLrqSo8KL0 mg5g== X-Gm-Message-State: AODbwcDAVVW9FQBYy8dj6vytcHy2u93vxeJcWktvpE5KXnI4Z8oo51xq qLlGFoALJQqG6w== X-Received: by 10.223.157.10 with SMTP id k10mr2695248wre.171.1497114848861; Sat, 10 Jun 2017 10:14:08 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-cca2-bae7-97d4-1425.holly.idiocy.org. [2001:8b0:3f8:8129:cca2:bae7:97d4:1425]) by smtp.gmail.com with ESMTPSA id f3sm6057211wrf.2.2017.06.10.10.14.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Jun 2017 10:14:07 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:215565 Archived-At: On Sun, Jun 11, 2017 at 12:04:06AM +0900, Jean-Christophe Helary wrote: > I got the repository from Savannah and each time I want to update it > I do a "git pull origin master". If I have worked on some files > before that I usually get a message asking me to commit my files > otherwise they'd be overwritten. Since I'm not pushing anything to > Savannah I feel that committing to the local Master is useless and > will only create discrepancies between my repository and Savannah. I find the easiest way to deal with this is to commit the change, and then pull using -r git pull -r to rebase my unpushed commit back on the top. I can then use git commit --amend to make further changes to that commit, but make sure you NEVER amend a commit that you’ve already pushed to the repository because that breaks things. If you then want to get rid of the commit you can just do git reset --hard HEAD~1 The number at the end represents the number of commits you want to delete. If you only want to delete your unstaged changes (and staged too? I’m not sure) you can do git reset --hard It’s safe to delete too many commits as a git pull will bring you right back up to date with the repository again. An alternative I’ve used in the past is to stash the files and then pop them back once I’ve finished with the pull, but I find committing them locally and rebasing is often neater, especially if I have installed someone else’s patches for testing and therefore have multiple unpushed commits. -- Alan Third