* Fwd: git rm [not found] <CAK8tuqiZjfrvHCoxkFUqoDx0+9=FUxfE93aMhUkYYZAAWm-u_w@mail.gmail.com> @ 2016-07-05 21:55 ` Peter 2016-07-06 16:42 ` Andreas Schwab 0 siblings, 1 reply; 7+ messages in thread From: Peter @ 2016-07-05 21:55 UTC (permalink / raw) To: git Greetings to the community of this wonderful piece of software! I am a lightweigt git user so by all means not a reference, but I was wondering why exactly does "git rm" also delete the file (remove it from the working tree). I see it as an unintended behaviour as git is written in a way that it preserves the most data. Usually git commands are very basic and the usual workflow requires more consecutive commands, it even has its own shell. But "git rm" does everything in one step even though there are lots of scenarios where the file should be kept. I am aware of the "git rm --cache" command, but from my perspective "git rm --delete" is the one that is needed... GUI users and some CLI users (by using trash-put or similar tool) also use trash before removing the file completely. Does "git rm" support freedesktop.org trash specification? Thank you for your answers in advance, Peter ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fwd: git rm 2016-07-05 21:55 ` Fwd: git rm Peter @ 2016-07-06 16:42 ` Andreas Schwab 2016-07-07 3:35 ` Jeff King 0 siblings, 1 reply; 7+ messages in thread From: Andreas Schwab @ 2016-07-06 16:42 UTC (permalink / raw) To: Peter; +Cc: git Peter <peter.mx@gmail.com> writes: > I am a lightweigt git user so by all means not a reference, but I was > wondering why exactly does "git rm" also delete the file (remove it > from the working tree). I see it as an unintended behaviour as git is > written in a way that it preserves the most data. The data is still preserved. You can restore it with "git checkout HEAD <file>". Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fwd: git rm 2016-07-06 16:42 ` Andreas Schwab @ 2016-07-07 3:35 ` Jeff King 2016-07-10 8:38 ` Peter 0 siblings, 1 reply; 7+ messages in thread From: Jeff King @ 2016-07-07 3:35 UTC (permalink / raw) To: Andreas Schwab; +Cc: Peter, git On Wed, Jul 06, 2016 at 06:42:19PM +0200, Andreas Schwab wrote: > Peter <peter.mx@gmail.com> writes: > > > I am a lightweigt git user so by all means not a reference, but I was > > wondering why exactly does "git rm" also delete the file (remove it > > from the working tree). I see it as an unintended behaviour as git is > > written in a way that it preserves the most data. > > The data is still preserved. You can restore it with "git checkout HEAD > <file>". Assuming the file is present in HEAD, of course. But if it is not, then git should (and does) complain and ask for "-f". -Peff ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fwd: git rm 2016-07-07 3:35 ` Jeff King @ 2016-07-10 8:38 ` Peter 2016-07-10 10:57 ` Andreas Schwab 0 siblings, 1 reply; 7+ messages in thread From: Peter @ 2016-07-10 8:38 UTC (permalink / raw) To: Jeff King; +Cc: Andreas Schwab, git So if I do: touch abc git add abc And after that I do: git rm abc Can you agree that there is an asymmetry of two commands vs. one? Git add only touches the files in .git/ and git rm ALSO affects the working tree... Is "git rm" or "git rm --cache" used more often in practice? Peter On 7 July 2016 at 05:35, Jeff King <peff@peff.net> wrote: > On Wed, Jul 06, 2016 at 06:42:19PM +0200, Andreas Schwab wrote: > >> Peter <peter.mx@gmail.com> writes: >> >> > I am a lightweigt git user so by all means not a reference, but I was >> > wondering why exactly does "git rm" also delete the file (remove it >> > from the working tree). I see it as an unintended behaviour as git is >> > written in a way that it preserves the most data. >> >> The data is still preserved. You can restore it with "git checkout HEAD >> <file>". > > Assuming the file is present in HEAD, of course. But if it is not, then > git should (and does) complain and ask for "-f". > > -Peff ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fwd: git rm 2016-07-10 8:38 ` Peter @ 2016-07-10 10:57 ` Andreas Schwab 2016-07-10 12:23 ` Peter 0 siblings, 1 reply; 7+ messages in thread From: Andreas Schwab @ 2016-07-10 10:57 UTC (permalink / raw) To: Peter; +Cc: Jeff King, git Peter <peter.mx@gmail.com> writes: > So if I do: > > touch abc > git add abc > > > And after that I do: > > git rm abc error: the following file has changes staged in the index: abc (use --cached to keep the file, or -f to force removal) Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fwd: git rm 2016-07-10 10:57 ` Andreas Schwab @ 2016-07-10 12:23 ` Peter 2016-07-10 12:45 ` Andreas Schwab 0 siblings, 1 reply; 7+ messages in thread From: Peter @ 2016-07-10 12:23 UTC (permalink / raw) To: Andreas Schwab; +Cc: Jeff King, git Ah, ok, I see now. But are there any other situations where the "-f" switch is not needed? Peter On 10 July 2016 at 12:57, Andreas Schwab <schwab@linux-m68k.org> wrote: > Peter <peter.mx@gmail.com> writes: > >> So if I do: >> >> touch abc >> git add abc >> >> >> And after that I do: >> >> git rm abc > error: the following file has changes staged in the index: > abc > (use --cached to keep the file, or -f to force removal) > > Andreas. > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 > "And now for something completely different." ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fwd: git rm 2016-07-10 12:23 ` Peter @ 2016-07-10 12:45 ` Andreas Schwab 0 siblings, 0 replies; 7+ messages in thread From: Andreas Schwab @ 2016-07-10 12:45 UTC (permalink / raw) To: Peter; +Cc: Jeff King, git Peter <peter.mx@gmail.com> writes: > Ah, ok, I see now. But are there any other situations where the "-f" > switch is not needed? When the file is unmodified and matches the index. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-07-10 12:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAK8tuqiZjfrvHCoxkFUqoDx0+9=FUxfE93aMhUkYYZAAWm-u_w@mail.gmail.com>
2016-07-05 21:55 ` Fwd: git rm Peter
2016-07-06 16:42 ` Andreas Schwab
2016-07-07 3:35 ` Jeff King
2016-07-10 8:38 ` Peter
2016-07-10 10:57 ` Andreas Schwab
2016-07-10 12:23 ` Peter
2016-07-10 12:45 ` Andreas Schwab
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.