* Why does git stash create two commits?
@ 2012-01-30 18:20 Phillip Susi
2012-01-30 18:25 ` Seth Robertson
2012-01-30 19:11 ` Junio C Hamano
0 siblings, 2 replies; 3+ messages in thread
From: Phillip Susi @ 2012-01-30 18:20 UTC (permalink / raw)
To: git
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
git stash makes two commits, one that has no changes from the base,
and one to stash your changes in. Why?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJPJt97AAoJEJrBOlT6nu75G1cH/1qXXMFBPr5vGZbPXCCgG4eG
nmTVlVjxa9Wk52rY/o3NfrgDrftuKIeMdjrFxe/hOsuU37rfMUpWlGa6wtwOIgHL
Cm2s/+PssrOwpajb+v3h+0vqZGNULaxPNpApDjB4JWTxNs86aCV/+zkzoqNjO8y4
OfAZnzqe03BJmPjldvygswD0RMvRvBuHyGRVhTgATcc89yZmihFxCNyekHdVUSvD
zVIUgyUj1vlSRDnSJrtARbKR3JZQeTtN6rMLIOxN0T3iOkltMWFGMoVbJ23kiUyD
LuMSNMrBvvkEU6g6czqQNNyreSut/b1r1ZTt/pvF0qDWUE5CZ9Qhgs6Xz7prtWs=
=Yp0K
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why does git stash create two commits?
2012-01-30 18:20 Why does git stash create two commits? Phillip Susi
@ 2012-01-30 18:25 ` Seth Robertson
2012-01-30 19:11 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Seth Robertson @ 2012-01-30 18:25 UTC (permalink / raw)
To: Phillip Susi; +Cc: git
In message <4F26DF7B.7050109@ubuntu.com>, Phillip Susi writes:
git stash makes two commits, one that has no changes from the base,
and one to stash your changes in. Why?
git-stash can make up to three commits:
working directory (of files git knows about)
index
working directory (of files git does not know about)
The third commit only appears if you use --all or --include-untracked.
Most likely you do not use -u/-a and your index has not been touched
yet, so you only see two commits, of which one is empty.
-Seth Robertson
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why does git stash create two commits?
2012-01-30 18:20 Why does git stash create two commits? Phillip Susi
2012-01-30 18:25 ` Seth Robertson
@ 2012-01-30 19:11 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2012-01-30 19:11 UTC (permalink / raw)
To: Phillip Susi; +Cc: git
Phillip Susi <psusi@ubuntu.com> writes:
> git stash makes two commits, one that has no changes from the base,
> and one to stash your changes in. Why?
The only reason the former is identical to the base is because you are not
incrementally building your next commit using "git add". It represents the
state of your index. The latter represents the state of the tracked files
in your working tree.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-30 19:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-30 18:20 Why does git stash create two commits? Phillip Susi
2012-01-30 18:25 ` Seth Robertson
2012-01-30 19:11 ` Junio C Hamano
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).