Live data from Hacker News

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

ohshitgit.com

181–190 of 352 posts

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

#181
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.

It's not free software though.

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

#182

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'm curious: What are the best free GUI for Git?

Sourcetree, if you are not on Linux like me :(

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

#184
post #130

Earlier quoted context omitted.

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

Have you tried GitKraken? https://www.gitkraken.com/ Seems like there's a glut of these apps of late—not that I'm complaining! :-)

It's built on electron, though.

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

#185
post #151

Earlier quoted context omitted.

Its true -- and actually the well designed gui that accurately depicts the graphical state of your local repository makes it far easier to learn the concepts behind git than does the command line. Distributed vc is conceptually nuanced, but not overly complicated -- the complexity of git really is in the interface wherein you are asked to map command line syntax into abstract operations that manipulate a state that y…

This looks like an awesome way to learn git, and many would probably love to continue with it - but many others too would prefer to move to the CLI. I used to use a GUI for git, but now I just find them cumbersome; by their nature requiring me to switch window for less.

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

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

#186
post #119

I really like this article but there is a problem with it: what happens if I use one of your techniques and I screw up? These steps you describe are a black box to someone who is no git savvy yet. While these definitely help but they propagate the "git is scary, cross your fingers" mentality. What I mean by this is that the reader won't be any wiser after reading > git reset HEAD~ --hard What is ~ after HEAD? What is…

After all this time the HEAD~ syntax has suddenly started making sense to me -- this is the syntax for backup files in vim, so HEAD~ is the "backup" i.e. previous version of HEAD.

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

#187
post #49

If you're concerned about not knowing how to do certain things with git, and understanding at a deeper level how git works, I highly recommend reading Scott Chacon's "Pro Git" book: https://progit.org/

That book is great, and so is the built-in gittutorial(7). If you really want to get down and dirty with Git, I'd also strongly recommend going one step further and reading gitcore-tutorial(7). It shows you the man behind the memorized commands curtain.

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

#188
post #159

I prefer stackoverflow for things like this as I can see from comments and up votes whether the command does what the poster claims, or whether it is going to make things worse for me.

Spend a few hours and really learn how Git works! Then you'll understand what those commands actually do and be able to judge for yourself. Great resources are the ProGit book, gittutorial(7) and eventually gitcore-tutorial(7) when you want to go deeper.

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

#189
post #155

Surprised he finds git to be complicated. It probably is deep down, but for day-to-day use, compare it to SVN. Until I switched, there was always a panic when branching or merging. With git, I can branch like a nutter and things seem to still work out in the end. Not sure why, perhaps someone else has a perspective on it.

In my experience it's all fine and dandy until you hit a rebase or merge that needs manual attention.

In mine, not quite. All forms of merges are simple: resolve, add, commit. Inside a rebase I find it harder to memorize whether I need to to the add and/or commit or rebase --continue does it for me.

And conflicts from 'stash pop' are somewhat counterintuitive to handle.

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

#190
post #147

Another option is to use Mercurial with hg-git to GitHub for network effects. I've been doing that for a while for dropbear ssh, it does hit occasional problems but is overall more pleasant than straight git.

To each his own, of course. As a Git aficionado, I find Mercurial utterly baffling. Branches are permanent and global? You have to clone the repo to make a new thing I would call a branch? "hg log" shows you things that are not in the history of your current source tree? Mind boggling.

:)

Post reply on HN