Live data from Hacker News

Oh shit, git: Getting myself out of bad situations

ohshitgit.com

301–310 of 520 posts

Re: Oh shit, git: Getting myself out of bad situations

#301

On barrier to learning git is that people are understandably reluctant to try things out because they are working in real repositories. This site makes a game out of learning git: https://learngitbranching.js.org/ It's a great way to learn without putting your real repository at risk.

Thanks, I am new to git and already made some dumb mistakes with my real repo and had to start over. Now I'm terrified to try anything past pulling and pushing to master. Hopefully this helps me understand branching so I don't feel like I will break it all again.

Re: Oh shit, git: Getting myself out of bad situations

#302

Honestly, a lot of what's wrong in git is that people seem to mostly memorize or copy-paste a finite amount of commands, and when something goes wrong they are completely lost unless they can find a way to copy-paste a solution. Instead of saving a 6 command list for some use cases, why not just get used to the simple but kinda unintuitive way of how revisions and branches work? If you know that, you can solve any pr…

I think you already answered your own question. It is very hard to get comfortable with things if they are unintuitive :)

Re: Oh shit, git: Getting myself out of bad situations

#303

Earlier quoted context omitted.

* there's no reason you have to use all these git features * If you are not using all of the Git features, then why use Git? Why not use something simple, like Subversion? As I wrote in the linked essay: ------------------- When I list these complaints for developers, most of them respond “You are complaining about Git’s power. The stuff you list isn’t really a flaw, rather those are all examples of how amazing Git i…

Because git is magnitudes of times faster, and it's the most widespread VCS in the world at the moment.

Those are weak reasons, if Git is the wrong choice for the team.

Re: Oh shit, git: Getting myself out of bad situations

#305
post #123

Earlier quoted context omitted.

I use the git CLI. I do it for one reason. I know exactly what i'm doing on it. I have nothing to prove to anyone, I'm not trying to impress anyone with my "hacker" skillz. When I've tried GUI's, I'm not 100% sure what's going on under the covers. Sometimes they try to obfuscate things. While I'm probably not the worlds most advanced user, I know enough to know what I want to do, and how to do it. The CLI let's me do…

You might want to try Sourcetree if you haven't already. I felt the same way about Git GUIs for a long time, but Sourcetree actually does a good job of getting out of my way, and has a very nice commit history tree viewer to boot.

Actually I find Sourcetree one of the worst git GUIs out there. There are just so many bugs and kinks and glitches in it that I avoid it if possible.

I do like the Gitx-dev fork by Rowanj [1]. Clean and simple. Unfortunately just for Mac OS though.

[1] https://rowanj.github.io/gitx/

Re: Oh shit, git: Getting myself out of bad situations

#306

Maybe it's not worth being in there because of how simple it is, but I guess it would be useful for newcomers: # Oh shit, I've changed 200 files and want to revert to the state of this morning $ git add . && git commit # often. Very often. $ git reset --hard commit_id

git reset --hard for what!? If you are a newcomer making mistakes it is fine for the mistake to be in the commits. Just fix the problem and commit again.

Re: Oh shit, git: Getting myself out of bad situations

#308
post #36

Earlier quoted context omitted.

I'm planning on making a hard push for git on the team I just joined (that isn't using any VCS). This and OP are going in my bookmarks.

I'm genuinely curious how they manage source without any VCS. Is it just a bunch of zip files for old versions? No judgment, nobody is born knowing this stuff, just that I'm surprised to hear this is still out in the wild.

I remember joining a company where the official build was cut from whatever was on the engineer's PC at the time, since that PC was the only one set up that could build the software. No documentation, no formal bug tracking, no source control, very infrequent backups that were probably never tested. It was basically a "0 on the Joel Test" shop. This software was for embedded aerospace applications too (however not safety-critical where DO-178B would apply, thank god).

Re: Oh shit, git: Getting myself out of bad situations

#309

  git checkout name-of-the-correct-branch
  # grab the last commit to master
  git cherry-pick master
  # delete it from master
  git checkout master
  git reset HEAD~ --hard
The two lines in the middle can be

  git cherry-pick -
  git checkout -
, and voila, it suddenly is name insensitive.

Re: Oh shit, git: Getting myself out of bad situations

#310

Earlier quoted context omitted.

> He was learning a great deal about many other technologies, and he didn’t have any spare energy to learn about Git. Git is something that you can use on almost any project, with any team, at any company. It's something you need to use if you want to contribute to open source. Aside from your programming language of choice, it's probably the second most useful tool you should be learning as a software developer. You…

* Your attitude is the exact opposite. * You setting your theory against my lived experience. If you want to understand the situation more fully, you can read How To Destroy A Tech Startup In Three Easy Steps: https://www.amazon.com/Destroy-Tech-Startup-Easy-Steps/dp/09... I did my best to re-create the extent to which decisions were driven by panic and the pressure of time. Please note, every company in the world ha…

> Sital's attitude was a major problem

Would it be the best if Sital never committed his changes? That way he would not be able to hurt your project and you would be able to fire Sital sooner.

Post reply on HN