all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "John Wiegley" <johnw@newartisans.com>
To: emacs-devel@gnu.org
Subject: Re: git is screwed
Date: Thu, 26 Mar 2015 10:10:27 -0500	[thread overview]
Message-ID: <m24mp7dcbg.fsf@newartisans.com> (raw)
In-Reply-To: <E1Yb5Qr-0006te-PF@fencepost.gnu.org> (Richard Stallman's message of "Thu, 26 Mar 2015 06:54:37 -0400")

>>>>> Richard Stallman <rms@gnu.org> writes:

> Looking at man git-stash

>        save [-p|--patch] [--[no-]keep-index] [-u|--include-untracked]
>        [-a|--all] [-q|--quiet] [<message>]
>            Save your local modifications to a new stash, and run git reset
>            --hard to revert them. The <message> part is optional and gives the
>            description along with the stashed state. For quickly making a
>            snapshot, you can omit both "save" and <message>, but giving only
>            <message> does not trigger this action to prevent a misspelled
>            subcommand from making an unwanted stash.

> That sounds dangerous so I didn't do it yet.  Is that what I should do?

Before you do a complex operation (such as a pull when you have both locally
committed changes, and locally uncommitted changes), you can run "git stash"
to safely squirrel away your work.  It sounds dangerous from the man page, but
it's a very safe operation.  I do it regularly.

Then, proceed with your complex operation.  Once you get everything back to a
sane and reasonable state, you can "git stash pop" to move your local changes
from the stash back to the working tree.  If these changes conflict, you will
be left with conflicted files that need manual resolution, but that is all.
Think of the stash as a highly temporary branch (which is what it really is,
behind the scenes) to which your work has been saved for the time being.

Some people have even created a "git-smart-pull" utility that automatically
does a stash save/pop when necessary before a pull, in order to be consistent
in their workflow.  I don't have a link handy, but others might also use it
and can comment.

John



  reply	other threads:[~2015-03-26 15:10 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-22 14:17 git is screwed Richard Stallman
2015-03-22 14:53 ` Andreas Schwab
2015-03-23  3:25   ` Richard Stallman
     [not found] ` <20150322154147.GA6808@Tron.local>
     [not found]   ` <E1YZszx-0004Ff-JK@fencepost.gnu.org>
2015-03-23  4:52     ` Sam Gwydir
2015-03-23  9:56       ` Harald Hanche-Olsen
2015-03-24 15:54         ` Richard Stallman
2015-03-24 16:26           ` Harald Hanche-Olsen
2015-03-26 10:54             ` Richard Stallman
2015-03-26 11:11               ` Harald Hanche-Olsen
2015-03-26 11:27                 ` Harald Hanche-Olsen
2015-03-26 12:21                 ` Steinar Bang
2015-03-26 14:16                   ` Stefan Monnier
2015-03-26 17:04                   ` Eli Zaretskii
2015-03-26 19:02                     ` Steinar Bang
2015-03-26 20:29                       ` Eli Zaretskii
2015-03-26 22:34                         ` Stefan Monnier
2015-03-27  7:24                           ` Eli Zaretskii
2015-03-27 13:09                             ` Stefan Monnier
2015-03-27 19:35                             ` Steinar Bang
2015-03-27 19:59                               ` Eli Zaretskii
2015-03-27 20:36                                 ` Steinar Bang
2015-03-27 19:30                         ` Steinar Bang
2015-03-26 10:54             ` Richard Stallman
2015-03-26 15:10               ` John Wiegley [this message]
2015-03-26 10:54             ` Richard Stallman
2015-03-25  8:29           ` Steinar Bang
2015-03-25 10:29             ` Artur Malabarba
2015-03-25 12:41             ` Stefan Monnier
2015-03-25 13:42               ` Steinar Bang
2015-03-25 14:32               ` Artur Malabarba
2015-03-25 23:23               ` Jonas Bernoulli
2015-03-26  0:35                 ` Stefan Monnier
2015-03-26  1:42                 ` John Yates
2015-03-26  2:04                   ` Stefan Monnier
2015-03-26  8:00                 ` Steinar Bang
2015-03-26  8:28                   ` Alexis
2015-03-26  8:41                     ` Alexis
2015-03-26  8:58                   ` Artur Malabarba
2015-03-26 10:27                 ` Rasmus
2015-03-26 19:01                   ` Ricardo Wurmus
2015-03-26 19:08                     ` Rasmus
2015-03-26 23:41                       ` Jonas Bernoulli
2015-04-01 20:41 ` Harald Hanche-Olsen
2015-04-03 11:00   ` Richard Stallman

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=m24mp7dcbg.fsf@newartisans.com \
    --to=johnw@newartisans.com \
    --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.