this post was submitted on 20 Nov 2024
672 points (97.3% liked)

Programmer Humor

19623 readers
2078 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
672
submitted 18 hours ago* (last edited 17 hours ago) by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 6 points 17 hours ago (18 children)

Hm ok yeah, that seems quite scary sounding so that i would strongly hesitate before clicking on "discard ALL changes". Still, I wonder if a second confirmation dialog with more information is warranted for a command that's so destructive.

[–] conciselyverbose 57 points 17 hours ago (16 children)

I wouldn't assume "discard changes" means "delete files that existed before the editor did".

[–] [email protected] 9 points 16 hours ago (10 children)

It's changes from the prior commit in the repository, which, if they had not committed anything prior, would have been an empty directory.

This is perhaps a good lesson in teaching version control as its own concept rather than "streamlining it" by bundling it with an editor.

[–] Scubus 0 points 16 hours ago (2 children)

Ok then, the changes to the repository shouldve been discarded. Anything he uploaded shouldve been deleted from the server. Why were files on his local machine deleted?

[–] [email protected] 8 points 14 hours ago

The repository in Git isn't on the server, it's on your local machine.

[–] [email protected] 3 points 14 hours ago (1 children)

What makes you think a server was involved here? It was a local repository, evidenced by the reporter's bewilderment that files can be deleted without going to the Recycle Bin first. Which tells us that in addition to VCS, they were unfamiliar with Windows as well.

[–] Scubus 3 points 13 hours ago (2 children)

Admittedly i dont use source control myself as im a hobbiest, but I didnt realize that git was local. As for the recycle bin bit, yeah theyre kinda dumb. Is source control different from git?

[–] WolfLink 2 points 4 hours ago* (last edited 4 hours ago)

You may be confusing git with GitHub.

git is a version control tool that lets you keep and manage a history of the files you are editing

GitHub is a website (not directly affiliated with the group maintaining git) that lets you upload, backup, and share your code using the format used by the git tool.

source control just refers to software to manage your source code in some form. git is the most popular tool of its kind, but there are others, for example mercurial.

[–] [email protected] 4 points 13 hours ago

Hobbyist myself so no worries! Git is one example of source control / version control software. You normally have your local working copy of a repository and then a remote where you push your changes when they are finished or to share them with others.

load more comments (7 replies)
load more comments (12 replies)
load more comments (13 replies)