News for hackers. Stuff that matters.
Re:Oh shit, git: Getting myself out of bad situations by emeraldd on Monday December 18, 2017 @10:50AM (#15952404)
What GUI do you recommend? My experience has been that GUIs are the easiest and fastest way to make a mess that can't be corrected without dropping to CLI or re-cloning. (I'm looking at you SourceTree). I've long recommended that everyone who uses git know how to use the CLI even if they don't use it regularly.
Re:Oh shit, git: Getting myself out of bad situations by filereaper on Monday December 18, 2017 @12:45PM (#15953522)
I'd like to also point out tig. "Tig is an ncurses-based text-mode interface for git"

It doesn't have all the bells and whistles of a GUI, but if you need to look at all the branches, and commits to a repository. tig is an excellent tool. tig doesn't issue any commands though, its only a browser, you'll still need to know the CLI. (essentially a ncurses version of gitk)

I'm normally in a ssh session on a remote box where my compile & run cycles happen. tig is curses based, so no X11 needed, filled in a really nice itch of mine.

[1] https://github.com/jonas/tig

Re:Oh shit, git: Getting myself out of bad situations by archon810 on Tuesday December 19, 2017 @01:44AM (#15958261)
+1 for tig. I'm also a big fan.
Re:Oh shit, git: Getting myself out of bad situations by neves on Monday December 18, 2017 @11:35AM (#15952850)
I tested a bunch of Git GUIs. My requisites:

- Open source (and free) - Multiplataform

The one with the best usability was Git Extensions: https://github.com/gitextensions/gitextensions

It is somewhat old ugly, and open a little too much of dialogs, but the workflow really works. It guides you to make the right thing.

A great plus is that it already comes with Kdiff3, a great open source 3 way diff open source program.

Re:Oh shit, git: Getting myself out of bad situations by xeromal on Monday December 18, 2017 @01:50PM (#15954175)
Agreed, Git Extensions taught me Git visually rather than through a tutorial.
Re:Oh shit, git: Getting myself out of bad situations by kenoyer130 on Monday December 18, 2017 @11:30AM (#15952801)
The Git GUI that ships with git is very good. It also shows how Git thinks (workspace/staging/commit) that most other gui's struggle with (they try to make it look more like a SVN workflow). For diffs and blame I use TortioseGit. I also extensively use the CLI for most branch actions.
Re:Oh shit, git: Getting myself out of bad situations by welly on Monday December 18, 2017 @10:54AM (#15952444)
If you're on a mac, I can't recommend Tower enough. It's a paid app but well worth the money. Otherwise Git Kraken is a foss offering that is also excellent.
Re:Oh shit, git: Getting myself out of bad situations by Ajedi32 on Monday December 18, 2017 @10:57AM (#15952472)
Git Kraken isn't FOSS. The site says "Free for non-commercial use", and AFAIK the source isn't available anywhere.

I think maybe the term you're looking for is "freeware"?

Re:Oh shit, git: Getting myself out of bad situations by welly on Tuesday December 19, 2017 @04:55AM (#15959053)
Ah, you're quite right. I was under the impression it was FOSS - I used it a while ago, preferred Tower and so went back to that.
Re:Oh shit, git: Getting myself out of bad situations by mistersquid on Monday December 18, 2017 @11:05AM (#15952561)
I second your recommendation of Tower. About a year ago, I made a comment right here on HN singing Tower's praise names. [0]

It's impossible to sing those names loudly enough.

  [0] https://news.ycombinator.com/item?id=12677542
Re:Oh shit, git: Getting myself out of bad situations by shagie on Monday December 18, 2017 @11:08AM (#15952593)
Apparently, there is now also a windows version. https://www.git-tower.com/windows
Re:Oh shit, git: Getting myself out of bad situations by GFischer on Tuesday December 19, 2017 @03:30PM (#15963949)
Thanks, I had disregarded Tower until I saw your comment :)
Re:Oh shit, git: Getting myself out of bad situations by dewey on Monday December 18, 2017 @11:44AM (#15952938)
I want to second that. Also the integration with diff tools like Kaleidoscope is a nice touch. (Even though Kaleidoscope feels like abandonware at this point)
Re:Oh shit, git: Getting myself out of bad situations by machiaweliczny on Monday December 18, 2017 @02:40PM (#15954732)
Gitup is free and probably better.
Re:Oh shit, git: Getting myself out of bad situations by welly on Tuesday December 19, 2017 @04:59AM (#15959077)
Thanks for the tip, I'll have to check it out.
Re:Oh shit, git: Getting myself out of bad situations by Froyoh on Monday December 18, 2017 @01:32PM (#15953978)
How is atlassian's Sourcetree?
Re:Oh shit, git: Getting myself out of bad situations by prewett on Monday December 18, 2017 @01:50PM (#15954190)
I like it a lot, it make git as simple as mercurial. I don't think it is hiding complexity, but the visual arrangement makes sense. The staging area becomes actually useful, and I love that you can stage (or revert) pieces of a file, which is handy when you forgot to commit one thing before moving on to the next.

I've only had to merge a branch once, and here I was completely confused on what was going end. This may be SourceTree's fault or git's fault. Maybe my lack of understanding.

I hate git, I don't understand git, I don't want to have to understand git, and I think the command line interface makes every UI error in the book. But SourceTree has made me like git.

Re:Oh shit, git: Getting myself out of bad situations by welly on Tuesday December 19, 2017 @04:57AM (#15959068)
We have a bunch of projects that are stored in a mercurial repo so I've been using Sourcetree for that as I've found MacHG pretty unusable. I think it's pretty good, not as good in my opinion (the UI, mainly) as Tower for Mac which I use for Git, but makes Mercurial easy to use for this (somewhat) hardened Git user.
Re:Oh shit, git: Getting myself out of bad situations by tigershark on Monday December 18, 2017 @03:11PM (#15955022)
Incredibly slow. I was never annoyed so much when using a software...
Re:Oh shit, git: Getting myself out of bad situations by gumby on Monday December 18, 2017 @11:30AM (#15952797)
> What GUI do you recommend?

I really like Magit, which is a git GUI you can use without leaving Emacs. It handles 90% of my git needs and is very tightly integrated into my IDE (Emacs). I still use some shell commands (like git mv) occasionally but those are simply m-! away.

Re:Oh shit, git: Getting myself out of bad situations by aldanor on Monday December 18, 2017 @12:05PM (#15953124)
Second that; I'm using Spacemacs just for Magit and nothing else, although it's mainly vim or clion for development. Haven't seen a single git client that would be close to Magit; too sad it needs Emacs, could have potentially been an awesome standalone...
Re:Oh shit, git: Getting myself out of bad situations by aoeuhtns on Monday December 18, 2017 @11:00AM (#15952507)
Magit in emacs. Probably one of the killer applications for emacs.
Re:Oh shit, git: Getting myself out of bad situations by karmajunkie on Monday December 18, 2017 @11:15AM (#15952648)
+1, along with Tig (console gui).
Re:Oh shit, git: Getting myself out of bad situations by menacingly on Monday December 18, 2017 @12:00PM (#15953080)
Thanks for telling me about tig, now I'm justified for having browsed HN today.

It treats my "assume everything works like vim" habit well

Re:Oh shit, git: Getting myself out of bad situations by alunaryak on Monday December 18, 2017 @12:13PM (#15953211)
tig is great -- it makes it very easy to stage individual lines of code (using 1) or to reset unstaged changes on a file (using ! in the status view).
Re:Oh shit, git: Getting myself out of bad situations by karmajunkie on Tuesday December 19, 2017 @11:43AM (#15961452)
it covers like 80% of my use-cases (which I use 99% of the time), and weirdly magit gets me the other 20% if I can remember which trail of breadcrumbs I follow through helm to make it happen. For the easier stuff I just drop down into the cli though.
Re:Oh shit, git: Getting myself out of bad situations by bradyholt on Monday December 18, 2017 @02:15PM (#15954456)
I love tig!
Re:Oh shit, git: Getting myself out of bad situations by celeritascelery on Monday December 18, 2017 @11:30AM (#15952802)
Agreed. Best git interface I have ever used.
Re:Oh shit, git: Getting myself out of bad situations by monsieurbanana on Monday December 18, 2017 @11:22AM (#15952719)
I'd hesitate to call Magit a git GUI though.

If we take Ranger for example, who calls itself the "CLI file manager", then Magit is rather a "git CLI".

Re:Oh shit, git: Getting myself out of bad situations by gumby on Monday December 18, 2017 @11:39AM (#15952885)
>I'd hesitate to call Magit a git GUI though.

Why? It is designed for git and graphically displays revisions allowing you to pick and chose chunks of file and to revert individual changes.

Re:Oh shit, git: Getting myself out of bad situations by Achshar on Monday December 18, 2017 @11:18AM (#15952670)
I use sourcetree and it's pretty great, especially the aforementioned block-level staging.
Re:Oh shit, git: Getting myself out of bad situations by slobotron on Monday December 18, 2017 @11:14AM (#15952638)
Not the OP, but git cola works great for me.

https://git-cola.github.io/

Re:Oh shit, git: Getting myself out of bad situations by flatline on Monday December 18, 2017 @12:12PM (#15953199)
I personally switch between the command line, git gui and gitk. I haven’t yet found a suitable GUI replacement for those two.
Re:Oh shit, git: Getting myself out of bad situations by nastysquar3d on Monday December 18, 2017 @11:14AM (#15952630)
I use TortiseGit in my personal and work dev environments. It works works well. That being said, I have had to drop to CLI to fix things that were somewhat more hairy.
Re:Oh shit, git: Getting myself out of bad situations by neves on Monday December 18, 2017 @11:36AM (#15952862)
Tortoise was great on Subversion, but I don't like it for Git. The UI in thought to work with a centralized version control is isn't well adapted to Git.
Re:Oh shit, git: Getting myself out of bad situations by Noumenon72 on Monday December 18, 2017 @10:38PM (#15957537)
My company uses Mercurial still and TortoiseHg is the best thing about it. I can sling big piles of commits around, patch, graft, and search, it's all so easy. I hope it works as well for Git or Git can catch up.
Re:Oh shit, git: Getting myself out of bad situations by _pmf_ on Monday December 18, 2017 @11:14AM (#15952640)
I recommend SmartGit; it's not cheap, but it's really, really nice.
Re:Oh shit, git: Getting myself out of bad situations by keithnz on Monday December 18, 2017 @04:00PM (#15955464)
SmartGit is really nice.

It's also free for hobby / open source

but worth buying for commerical work, but it is pricey, and I think getting the lifelong updates is the way to go.

Re:Oh shit, git: Getting myself out of bad situations by nwatson on Monday December 18, 2017 @11:22AM (#15952718)
SourceTree by Atlassian ... free.
Re:Oh shit, git: Getting myself out of bad situations by mejari on Monday December 18, 2017 @12:46PM (#15953534)
For any Windows users out there, I use GitExtensions, which has served me very well over the years.
Re:Oh shit, git: Getting myself out of bad situations by Vel0cityX on Monday December 18, 2017 @02:52PM (#15954841)
I use SmartGit. Way faster and more stable than SourceTree and GitKraken, in my experience.
Re:Oh shit, git: Getting myself out of bad situations by archon810 on Tuesday December 19, 2017 @01:45AM (#15958263)
+1 for SmartGit, and SmartSVN if you ever use SVN.
Re:Oh shit, git: Getting myself out of bad situations by ggregoire on Monday December 18, 2017 @11:49AM (#15952984)
VSCode or Github Desktop (even if the project is on Gitlab).
Re:Oh shit, git: Getting myself out of bad situations by LiquidFlux on Monday December 18, 2017 @11:12AM (#15952617)
Not the OP, but I had come from SourceTree to GitKraken and it's a joy to use.
Re:Oh shit, git: Getting myself out of bad situations by yoodenvranx on Monday December 18, 2017 @11:16AM (#15952652)
Same for me! I used SourceTree in the past but at the moment I am using the free version of GitKraken for private projects and I am very happy.
Re:Oh shit, git: Getting myself out of bad situations by bolololo1 on Monday December 18, 2017 @11:48AM (#15952980)
I like GitKraken