[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stupid git!
Re: Stupid git!
Sat, 12 Sep 2015 10:21:59 +0000
On Sat, Sep 12, 2015 at 10:15:14AM +0000, Alan Mackenzie wrote:
> 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.
> So I did `git pull'. I was then dumped into an editing session for a
> merge operation for .../test/automated/file-notify-tests.el. Eh? I've
> never touched this file in my life, and didn't even know it existed. So
> why is a merge necessary/why has a merge been (half-)done? Why didn't
> git pull simply merge the changes to this file into my repository and
> working directory?
> 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.
Sorry, scrub that bit! My commit had saved the file OK. I'd got
confused with another situation in which git delete[sd] changes.
> How do I see what changes are in file-notify-tests.el, which is in the
> staging area? I would have thought some variety of `git diff' ought to
> do the trick, but how to do this is not made obvious in the fine manual
> for `git diff'.
> Time to save my changed file and have a coffee. Isn't git wonderful!
> Alan Mackenzie (Nuremberg, Germany).