Live data from Hacker News

Some bad Git situations and how I got myself out of them

ohshitgit.com

231–240 of 352 posts

Re: Some bad Git situations and how I got myself out of them

#232
post #130

Earlier quoted context omitted.

Only for iUsers... Really searching for a Linux alternative !

I don't know how it compares to GitUp, but SmartGit works on Linux, Windows, and macOS. I use it on all three platforms and recommend it highly. See my other comment in the subthread for more thoughts about it.

All GUI clients on Linux I tested are plenty of buttons and menus, it makes me cry...

Re: Some bad Git situations and how I got myself out of them

#233

I can't believe no one has responded yet with "use a GUI". After gaining a basic understanding of how branches and merges work, and I do mean basic , I've never been able to screw up a local repo with a GUI client enough that I haven't been able to recover with the same GUI tools. I understand that people need to know how to use their tools, but for git most people can get away with the very basic usage that GUIs pro…

I agree, and while I have not tried the other apps mentioned here, I do rely extensively on Atlassian SourceTree client for Mac and find it very useful.

Re: Some bad Git situations and how I got myself out of them

#234
post #213

> This usually happens to me if I merge to master, then run tests/linters... and FML, I didn't put a space after the equals sign. Am I the only one that runs my tests before committing, let alone merging to master?

Yeah, pushing untested code to master is not such a great way to work. Push to a remote branch other than master, test it there, then merge it into master. That's pretty much git 101

Or test locally? I work in government contracting so everything is .Net and TFS, but even in this environment it's trivial to make sure your code isn't objectively broken:

  1. Click "Run all tests"
On your local machine even thousands of tests only takes a few seconds including the build process. We've got automated testing in the dev and test environments as well but if you're failing those there's a failure in workflow somewhere. There's very little reason to fail a test or to have a broken build in source control.

Re: Some bad Git situations and how I got myself out of them

#236
Somebody proposed to use a GUI. That doesn't solve the usability issues of Git. There's this triangle of what the user tries to do, what the commands and options are called and what they actually do. None of them really align, though with some careful use you can actually make Git do what you want - eventually.

I would like to understand what's the yearly damage of such an important tool being so difficult to use. People committing the wrong stuff, unmergeable messes, people not being able to correct their mistakes, there must be thousands of Git rookies fucking up their Git repo or throwing away their work just as I am writing this.

What would be the cost? Millions of Dollars? Perhaps even billions?

It's about as bad as 0 being a legit value for a regular pointer.

Re: Some bad Git situations and how I got myself out of them

#237
post #185

Earlier quoted context omitted.

For commands maybe, but nothing beats a graphical history tree. It's hard for a human to imagine a complex branch history without a good visual aid

I can't think of a single time I've actually ever cared to look at anything other than a linear history or a single file's blame. I do have a 'hist' alias set up ( http://blog.wittchen.biz.pl/basics-of-git/#gist16617665 ), but it's not something I ever actually use.

Good for you. I'm probably not as smart and more likely to get confused without having the history laid out in the form of a clean, coloured graph. At any rate, it allows me to free whatever brain power I have for other purposes

Re: Some bad Git situations and how I got myself out of them

#238
There is no substitute for understanding what's going on, especially using a power tool like Git.

It's a cute website, and useful, I really like it. This sentence,

    Bizarrely, git won't do a dif of files that have 
    been add-ed to your staging area without this flag.
    File under ¯\_(ツ)_/¯"
just screams to me (a professional Git trainer), "I don't understand the Git staging area! I don't know my Git fundamentals! Train me!"

Re: Some bad Git situations and how I got myself out of them

#239

There is no substitute for understanding what's going on, especially using a power tool like Git. It's a cute website, and useful, I really like it. This sentence, Bizarrely, git won't do a dif of files that have been add-ed to your staging area without this flag. File under ¯\_(ツ)_/¯" just screams to me (a professional Git trainer), "I don't understand the Git staging area! I don't know my Git fundamentals! Train me…

Any resources you recommend for learning git in more detail?

Re: Some bad Git situations and how I got myself out of them

#240
post #236

Somebody proposed to use a GUI. That doesn't solve the usability issues of Git. There's this triangle of what the user tries to do, what the commands and options are called and what they actually do. None of them really align, though with some careful use you can actually make Git do what you want - eventually. I would like to understand what's the yearly damage of such an important tool being so difficult to use. Pe…

God, it's probably billions. I love git but its user interface is borderline criminal. The sad thing is mercurial has like 95% of git's power and is waaay easier to understand, but it never took off in a big way.
Post reply on HN