zsh-users
 help / color / mirror / code / Atom feed
* Re: git adventures
  2014-11-14 17:39 git adventures Ray Andrews
@ 2014-11-14 16:46 ` Nathan Schwarz
  2014-11-14 16:51   ` Nathan Schwarz
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nathan Schwarz @ 2014-11-14 16:46 UTC (permalink / raw)
  To: zsh-users

On 11-14/ 9:39, Ray Andrews wrote:
> Gitmeisters:
> 
> (CAPS NOT YELLING ;-)
> 
>    pts/0 HP-y5--5-Debian1 root /aMisc/zsh-code $ git pull --rebase
>    Cannot pull with rebase: You have unstaged changes.
>    Please commit or stash them.
> 
>    pts/0 HP-y5--5-Debian1 root /aMisc/zsh-code $ git pull
>    remote: Counting objects: 41, done.
>    remote: Compressing objects: 100% (29/29), done.
>    remote: Total 29 (delta 23), reused 0 (delta 0)
>    Unpacking objects: 100% (29/29), done.
>     From git://git.code.sf.net/p/zsh/code
>        e334119..8505837  master     -> origin/master
>    Updating e334119..8505837
>    error: Your local changes to the following files would be
>    overwritten by merge:
This will always fail as long as you have uncommitted or unstashed
changes. This is to prevent data loss.

> I'VE LEARNED ABOUT 'stage', BUT WHAT IS 'stash'?
> HOW DO I commit/stash/stage THAT ONE FILE SO AS TO PROCEED? CAN WE TELL GIT
> TO JUST NOT WORRY ABOUT THAT FILE--LEAVE IT BE, BUT PULL EVERYTHING ELSE?
> THAT CHANGED FILE IS OBVIOUSLY ONLY OF TEMPORARY VALUE.
`git stash $file` stashes changes as another form than a commit. This
means - the changes you made to the file are saved by git and the
working copy of your file is being reset to the index-file (working copy
== file you edit; index-file == file saved by git to determine changes).

This, of course, work also with just `git stash` to stash all current
changes in all files.

This way you can save changes on your local machine, pull changes from
upstream and then reapply your stashed work with `git stash apply
$stash`. To list saved states and get your $stash you can run `git stash list`.

> 
> FANTASTIC DOC:
> http://git-scm.com/book/en/v2
Refer to http://git-scm.com/book/en/v1/Git-Tools-Stashing for stashing.
> 
> I'M LIKING AND RESPECTING GIT ALREADY. MOST COOL THAT IT CLONES IT'S OWN
> ADMINISTRATION HERE AS WELL AS FILES, ALSO THAT IT REMEMBERS WHERE THE
> MOTHER SHIP IS. GENUINELY HELPFUL ERROR MESSAGES! HOW UN-LINUX.
That being said please respect our eyes and consider disabling
caps-lock.

-Nathan

-- 
/"\  ASCII Ribbon Campaign
\ /  - against HTML emails
 X   - against proprietory attachments
/ \  http://en.wikipedia.org/wiki/ASCII_Ribbon_Campaign


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git adventures
  2014-11-14 16:46 ` Nathan Schwarz
@ 2014-11-14 16:51   ` Nathan Schwarz
  2014-11-14 19:55   ` Ray Andrews
  2014-11-14 23:40   ` Bart Schaefer
  2 siblings, 0 replies; 6+ messages in thread
From: Nathan Schwarz @ 2014-11-14 16:51 UTC (permalink / raw)
  To: zsh-users

Additionally: If you don't need the changes made to the file, checkout
the working copy.
`git checkout $file`

This will overwrite the working copy with the index-file.

-Nathan
-- 
/"\  ASCII Ribbon Campaign
\ /  - against HTML emails
 X   - against proprietory attachments
/ \  http://en.wikipedia.org/wiki/ASCII_Ribbon_Campaign


^ permalink raw reply	[flat|nested] 6+ messages in thread

* git adventures
@ 2014-11-14 17:39 Ray Andrews
  2014-11-14 16:46 ` Nathan Schwarz
  0 siblings, 1 reply; 6+ messages in thread
From: Ray Andrews @ 2014-11-14 17:39 UTC (permalink / raw)
  To: zsh Users

Gitmeisters:

(CAPS NOT YELLING ;-)

    pts/0 HP-y5--5-Debian1 root /aMisc/zsh-code $ git pull --rebase
    Cannot pull with rebase: You have unstaged changes.
    Please commit or stash them.

    pts/0 HP-y5--5-Debian1 root /aMisc/zsh-code $ git pull
    remote: Counting objects: 41, done.
    remote: Compressing objects: 100% (29/29), done.
    remote: Total 29 (delta 23), reused 0 (delta 0)
    Unpacking objects: 100% (29/29), done.
     From git://git.code.sf.net/p/zsh/code
        e334119..8505837  master     -> origin/master
    Updating e334119..8505837
    error: Your local changes to the following files would be
    overwritten by merge:


THIS IS JUST TO FIX THAT PROBLEM I HAD WITH 'make check'.  COOL THAT
GIT KNOWS THAT, AND WON'T OVERWRITE IT.


         Test/B06fc.ztst
    Please, commit your changes or stash them before you can merge.
    Aborting

    pts/0 HP-y5--5-Debian1 root /aMisc/zsh-code $ git pull origin master
     From git://git.code.sf.net/p/zsh/code
      * branch            master     -> FETCH_HEAD
    Updating e334119..8505837
    error: Your local changes to the following files would be
    overwritten by merge:
         Test/B06fc.ztst
    Please, commit your changes or stash them before you can merge.
    Aborting

I'VE LEARNED ABOUT 'stage', BUT WHAT IS 'stash'?
HOW DO I commit/stash/stage THAT ONE FILE SO AS TO PROCEED? CAN WE TELL GIT
TO JUST NOT WORRY ABOUT THAT FILE--LEAVE IT BE, BUT PULL EVERYTHING ELSE?
THAT CHANGED FILE IS OBVIOUSLY ONLY OF TEMPORARY VALUE.

FANTASTIC DOC:
http://git-scm.com/book/en/v2

I'M LIKING AND RESPECTING GIT ALREADY. MOST COOL THAT IT CLONES IT'S OWN
ADMINISTRATION HERE AS WELL AS FILES, ALSO THAT IT REMEMBERS WHERE THE
MOTHER SHIP IS. GENUINELY HELPFUL ERROR MESSAGES! HOW UN-LINUX.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git adventures
  2014-11-14 16:46 ` Nathan Schwarz
  2014-11-14 16:51   ` Nathan Schwarz
@ 2014-11-14 19:55   ` Ray Andrews
  2014-11-14 23:40   ` Bart Schaefer
  2 siblings, 0 replies; 6+ messages in thread
From: Ray Andrews @ 2014-11-14 19:55 UTC (permalink / raw)
  To: zsh-users

On 11/14/2014 08:46 AM, Nathan Schwarz wrote:
> That being said please respect our eyes and consider disabling 
> caps-lock. -Nathan 
Ok. Bart said the same thing as well.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git adventures
  2014-11-14 16:46 ` Nathan Schwarz
  2014-11-14 16:51   ` Nathan Schwarz
  2014-11-14 19:55   ` Ray Andrews
@ 2014-11-14 23:40   ` Bart Schaefer
  2014-11-15  0:17     ` Nathan Schwarz
  2 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2014-11-14 23:40 UTC (permalink / raw)
  To: Nathan Schwarz, zsh-users

On Nov 14,  5:46pm, Nathan Schwarz wrote:
}
} > I'VE LEARNED ABOUT 'stage', BUT WHAT IS 'stash'?
} > HOW DO I commit/stash/stage THAT ONE FILE SO AS TO PROCEED? CAN WE TELL GIT
} > TO JUST NOT WORRY ABOUT THAT FILE--LEAVE IT BE, BUT PULL EVERYTHING ELSE?
} > THAT CHANGED FILE IS OBVIOUSLY ONLY OF TEMPORARY VALUE.
} `git stash $file` stashes changes as another form than a commit.

Hmm, "git stash $file" doesn't work for me -- it wants a keyword such as
"save" in the location where you have $file, and the only way to stash
selectively is with "git stash save --patch".  I don't see any mention
of stash accepting a file name in "man git-stash".


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git adventures
  2014-11-14 23:40   ` Bart Schaefer
@ 2014-11-15  0:17     ` Nathan Schwarz
  0 siblings, 0 replies; 6+ messages in thread
From: Nathan Schwarz @ 2014-11-15  0:17 UTC (permalink / raw)
  To: zsh-users

On 11-14/15:40, Bart Schaefer wrote:
> Hmm, "git stash $file" doesn't work for me -- it wants a keyword such as
> "save" in the location where you have $file, and the only way to stash
> selectively is with "git stash save --patch".  I don't see any mention
> of stash accepting a file name in "man git-stash".

Oy, I haven't used `git stash` in quite a while so either they changed
it or I wrongly assumed it followed the convention of other commands.

Either way - thanks for the correction and sorry for the wrong
information!

-Nathan
-- 
/"\  ASCII Ribbon Campaign
\ /  - against HTML emails
 X   - against proprietory attachments
/ \  http://en.wikipedia.org/wiki/ASCII_Ribbon_Campaign


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-15  0:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-14 17:39 git adventures Ray Andrews
2014-11-14 16:46 ` Nathan Schwarz
2014-11-14 16:51   ` Nathan Schwarz
2014-11-14 19:55   ` Ray Andrews
2014-11-14 23:40   ` Bart Schaefer
2014-11-15  0:17     ` Nathan Schwarz

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).