all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel@gnu.org
Subject: Re: Stupid git!
Date: Sat, 12 Sep 2015 12:40:20 +0200	[thread overview]
Message-ID: <87pp1n6huz.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <20150912101514.GA2322@acm.fritz.box> (Alan Mackenzie's message of "Sat, 12 Sep 2015 10:15:14 +0000")

Alan Mackenzie <acm@muc.de> writes:

> Hello, Emacs.
>
> git has struck again, and another couple of hours valuable time have
> been lost.
>
> Having "staged" a change with `git add', I then tried to commit it with
> `git commit'.  Somebody else had got in before me, so I had to pull
> their changes first - fair enough.

Uh, no?  git commit goes to your local repository.  There is nobody else
who could "get in before you".  You never need to pull before
committing.  You may want to rebase after pulling, depending on your
kind of change.

> So I aborted this merge operation, in order to see what it's doing
> first.  git has kindly discarded my (staged) change, leaving no record
> of its existence - good job I've still got a copy of the changed file
> in Emacs.  Scrabbling around in the .git directory, I found the commit
> message in a file there.  So all is not lost.
>
> How do I see what changes are in file-notify-tests.el, which is in the
> staging area?

git diff --cached

> Time to save my changed file and have a coffee.  Isn't git wonderful!

When things start looking fishy, don't just stumble on blindly.  Save
what you got somewhere else, and _then_ try muddling through.  That's
not particular to Git.

-- 
David Kastrup



  parent reply	other threads:[~2015-09-12 10:40 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-12 10:15 Stupid git! Alan Mackenzie
2015-09-12 10:21 ` Alan Mackenzie
2015-09-12 10:40 ` Dmitry Gutov
2015-09-12 12:29   ` Alan Mackenzie
2015-09-12 12:34     ` David Kastrup
2015-09-12 12:59       ` Alan Mackenzie
2015-09-12 20:14     ` Dmitry Gutov
2015-09-14 10:09     ` Steinar Bang
2015-09-12 20:37   ` Stefan Monnier
2015-09-12 10:40 ` David Kastrup [this message]
2015-09-12 10:53   ` Dmitry Gutov
2015-09-12 12:52   ` Alan Mackenzie
2015-09-12 11:45 ` Giuseppe Scrivano
2015-09-12 13:02   ` Alan Mackenzie
2015-09-12 14:12     ` Andreas Schwab
2015-09-12 15:16     ` Eli Zaretskii
2015-09-12 20:36       ` Alan Mackenzie
2015-09-12 20:43         ` Dmitry Gutov
2015-09-12 21:51           ` Alan Mackenzie
2015-09-13  6:22             ` Sven Axelsson
2015-09-14 10:21               ` Alan Mackenzie
2015-09-14 10:29                 ` David Kastrup
2015-09-14 12:19                   ` Eli Zaretskii
2015-09-14 12:28                     ` David Kastrup
2015-09-14 12:37                       ` Eli Zaretskii
2015-09-14 12:47                         ` David Kastrup
2015-09-14 13:38                           ` Eli Zaretskii
2015-09-14 13:44                             ` David Kastrup
2015-09-14 12:38                   ` Stefan Monnier
2015-09-13  6:49             ` Eli Zaretskii
2015-09-14 10:49               ` Alan Mackenzie
2015-09-15  0:24                 ` Stephen J. Turnbull
2015-09-13 20:28             ` Dmitry Gutov
2015-09-14  3:11               ` Stephen J. Turnbull
2015-09-14 13:47                 ` Dmitry Gutov
2015-09-14 11:09               ` Alan Mackenzie
2015-09-14 12:22                 ` Eli Zaretskii
2015-09-14 13:42                 ` Dmitry Gutov
2015-09-14 17:05                   ` Steinar Bang
2015-09-14 10:37             ` Steinar Bang
2015-09-13  6:42         ` Eli Zaretskii

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=87pp1n6huz.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /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.