4 ms·
This seems like putting a training wheel on a training wheel. git is already the easiest to understand of any VCS that I've used, and it's somewhat hard to do s
by zach_garwood 5y ago
This seems like putting a training wheel on a training wheel. git is already the easiest to understand of any VCS that I've used, and it's somewhat hard to do something in git that can't be reversed. As the articles states, it's unlikely you'll ever lose your changes. Further, this doesn't seem to be that different of a concept from git reset, so why not learn reset instead of yet another command?
- simias 5y agoHard disagree, git's docs and UI have improved over the years but every time I have to teach it to a beginner I realize how arcane and scary it is, especially when compared to old school centralized VCSs like subversion. Not that I'd trade git for subversion mind you, in the hands of a trained individual git is a godsend, but the training part can be arduous. Even among DVCSs I'd argue that mercurial for instance is vastly easier to pick up.
- zach_garwood 5y agoIf it's an issue of having to read the docs or the man, well I've been at work like this for a little over a decade and I still have to pull up a reference when I want to do something nontrivial in, not only git, but pretty much every cli tool I use on a regular basis. Cli tools, frameworks, libraries, languages... I have to pull up a reference for everything I do as a programmer, so it's hard for me to muster up the indignity for having to look up how git works. If it's a matter of understanding the flow of the tool, then I will have to concede that mercurial probably is easier to understand for the beginner.
- rileymat2 5y ago`git add <file>` Wait, how do I remove it from staging? It seems there should be some symmetric operation, `git remove <file>` or something. Maybe git rm `<file>`, whoa don't do that. No, it is `git reset HEAD -- <file>`. There is no mental symmetry. Or why use add at all? What am I adding it to? It is so generic, why not `git stage file` and `git unstage file`? I agree that you need to read and learn tools, but there is a lack of consistency and symmetry in many of the commands which make it harder.
- cerved 5y agoIt may not be the most mnemonic but it clearly says right in the CLI what you're supposed to do (use "git restore --staged <file>..." to unstage)
- rileymat2 5y agoIt looks like I get that message when I do a git status, not the git add. Also, it looks like "restore" was not added until august 2019. And I have not used it, but will in the future! But this does not exactly help the conceptual issues, because now we have `git revert`, `git reset`, and `git restore`. From an english concept perspective those words are all very similar in meaning.
- arxanas 5y agoGit reset doesn't e.g. reset the positions of multiple branches to their historical positions. In fact, some of that data can be lost forever to Git (branch deletions are not tracked anywhere).
- jcranmer 5y ago> git is already the easiest to understand of any VCS that I've used Breaks down in uproarious laughter. One of the worst offenses git is its use of multiple different jargon terms for the same concept; indeed, it's the only VCS I've used where reading help leaves me less sure than when I started if it does what I want it to do. If I accidentally leave my system in a weird state (say, I'm in the middle of a git rebase and I forgot to git rebase --continue), and I start doing some regular git commits, the resulting mistakes are, while possible to recover from, difficult to do so unless you know git's internals. I have to use the "what's that git command to list the commits I just dropped on the floor by accident?" with surprising frequency.
- zach_garwood 5y agoWhat are the jargon words youre referring to? In my experience, it uses the same jargon as the other VCSs. Perhaps you have a different workflow than me, but I don't find myself rebasing all that often to begin with. I generally don't rewrite history unless I truly fucked up. And since I'm in "I fucked up" mode, I take extra care with commands I type. I don't wanna be like Apple and say "You're holding the phone wrong," but maybe you shouldn't be doing frivolous rebasing.
- jcranmer 5y agoThe staging area (aka "index" aka good god don't try to read git glossary's index for this) is a bad one. There's definitely several cases where I've read the documentation and struggle to figure out if it will or will not affect the working checkout or not.
- cerved 5y agoIn the git bash on windows environment it clearly states that you're in the middle of a rebase. If this happens a lot you could implement that same functionality in your environment
- cerved 5y agoThis is the script that shows the current branch and things like an active REBASE in PS1 https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh https://github.com/git/git/blob/master/contrib/completion/gi...
- sedatk 5y ago> git is already the easiest to understand You mean Mercurial :)
- zach_garwood 5y agoI concede the point :)