4 ms·
Poe's Law is getting me on your comment. If it wasn't sarcasm, what's an example of a weakness? IMHO, there's a learning curve to using git and especially get
by pfarrell 5y ago
Poe's Law is getting me on your comment. If it wasn't sarcasm, what's an example of a weakness? IMHO, there's a learning curve to using git and especially getting to the point where you can be your team's go-to person for git questions. However, I hold the opinion that of the many technologies out there, git is among those that is worth any investment you can make in learning it. Personally, long term use of git has affected the way I code to bring more intention and organization to what I'm doing.
- _dain_ 5y agoquick: explain to me the difference between "git reset", "git revert" and "git restore", without looking up the docs.
- zibzab 5y agoBut are these things a normal user would need to care about? I bet if you created a great git desktop app with outstanding UI it would still have a few corners 99% of users would never touch or understand.
- _dain_ 5y ago> But are these things a normal user would need to care about? ... yes? I've used all three of those commands in the past, although I don't remember what they do. and I'm hardly a git expert.
- globular-toast 5y agoHow to undo a change or revert to a previous version? That sounds like a pretty fundamental thing that a user would need to do, yes.
- zibzab 5y agoIt is usually as easy as "git checkout ID". If that doesn't work you probably have done something really bad to begin with.
- ethomson 5y agoThat's probably not what you want. Checking out an ID would put you in a detached HEAD state, and the CLI will give you the page of warning messages that go along with it. I think that this is an excellent reminder that yes, the git CLI is not simple or obvious.
- karatinversion 5y agoMaybe you are newer to git, but this does not feel like a good faith comment, because “restore” is a command that was added specifically because people complained that the overloading of “checkout” is confusing. Anyway: “reset” changes the ref to which the HEAD branch points, and depending on options can also update the index and working tree to match as well. “Revert” creates a commit that is the reverse of an earlier commit. Restore rolls back uncommitted changes to a file. This isn’t hard?
- giraffe_lady 5y agoWhat definition of hard are you using? It's an industrial strength tool used almost exclusively by professionals and expert-level amateurs. It's definitely hard, the same way knowing what to do with a welding machine is hard. On the other hand, even among the professionals it has a reputation for being tricky and frustrating. Which is not the norm for most critical daily-use tools in this or any professional. So I'd also consider it hard in that sense.
- pfarrell 5y agogit reset: unstage a change git revert: create a commit that reverses a previous commit git restore: you got me. I can't remember
- rileymat2 5y agoReset is more overloaded once you add parameters.
- Accacin 5y agoI'm pretty basic with my Git knowledge. I can merge, rebase, reflog, and the other basic things. However, even I know the difference between reset, revert, restore, and generally use them daily. Now, I generally do not remember many of the extra arguments that can be passed apart from 'reset --hard/--soft', 'git log --stat/--oneline --decorate', etc. Personally I've found git complicated when I've worked at a place with bad 'git' discipline. When I've worked at companies with sane branching agreements, etc. I rarely face problems.
- rileymat2 5y agoDon’t forget rebase if we are doing this.
- spookthesunset 5y agoHmmm.... - reset: "blindly" load whatever commit you tell it into your working directory. This is the one if you add "--hard" will plow over your working directory in a way that cannot be undone. Actually I think without the "--hard" it won't make any changes to your working directory, it will treat whatever is in said directory as a change from the commit you told it to reset to. Dunno... have to look into it. - revert: Creates a new commit that undoes whatever commit you pass in. Often times people mistakenly use this to "undo" a merge into a production branch that shouldn't have happened. The result is trouble when they want to push those changes back into production again. - restore: I have no clue what this does. All I really know is "--hard" is one of like two commands that you can do in git that you can't back out of. "git clean" is another one (I think). Yeah... conceptually Git is kinda easy but the command line is pretty nuts.