Earlier quoted context omitted.
> I think anyone who uses the CLI is either trying too hard or hasn't realized the beauty of a git GUI. Or, you know, understands and thinks in the semantics of the underlying tool and is already working in other text-based tools.
Or, you know, that is irrelevant when the person using a GUI makes fewer errors than those who aren't (which has broadly been my experience as well). Even someone who perfectly understands git can make a typo or have a brain-fart of a day. A GUI significantly reduces the chances of something like that for all users. Sometimes dev obsession with tool purity does more damage than good.
Oh shit, git: Getting myself out of bad situations
391–400 of 520 posts
Re: Oh shit, git: Getting myself out of bad situations
#392The absolute worst situation I've gotten into was just the other day, when my team managed to check in two files with the same name, but different capitalization. The server (Bitbucket) is Linux-based, but all the workstations are Mac or PC, so the names collided on everyone's desktops. This prevented anyone from pulling or checking out a different branch, so even after master was fixed, everyone's environment stayed…
$ git status --short
## master...origin/master
M include/uapi/linux/netfilter/xt_connmark.h
M include/uapi/linux/netfilter/xt_dscp.h
M include/uapi/linux/netfilter/xt_mark.h
M include/uapi/linux/netfilter/xt_rateest.h
M include/uapi/linux/netfilter/xt_tcpmss.h
M include/uapi/linux/netfilter_ipv4/ipt_ecn.h
M include/uapi/linux/netfilter_ipv4/ipt_ttl.h
M include/uapi/linux/netfilter_ipv6/ip6t_hl.h
M net/netfilter/xt_dscp.c
M net/netfilter/xt_hl.c
M net/netfilter/xt_rateest.c
M net/netfilter/xt_tcpmss.cRe: Oh shit, git: Getting myself out of bad situations
#393Geez, using `git add .` is the worst thing you can do. Never use this. Tutorials: stop suggesting this. It's just a recipe to getting yourself into a mess (plus, you should never work so blindly!). Add individual files, and, if possible, use `git add -p`, which lets you review each chunk before adding it to the index. Otherwise, diff and add individual files.
Re: Oh shit, git: Getting myself out of bad situations
#394Honestly, 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…
Quick quiz, what does 'git checkout x/y' do? I am aware of users hitting at least 3 interpretations.
Re: Oh shit, git: Getting myself out of bad situations
#395> Oh shit, I accidentally committed to the wrong branch! I find cherry-picking to be easier in this case. Just checkout the branch and cherry pick commits from 'wrong' branch. https://git-scm.com/docs/git-cherry-pick
Re: Oh shit, git: Getting myself out of bad situations
#396Earlier quoted context omitted.
I use sourcetree, but I would like a console feature that shows me what commands its running. Similar to sequel pro's "console" feature shows the raw sql being run.
the commands themselves are not actually the lowest level, though! (and in fact, are kind of crazily mixed togther; most of the trouble people have w/ git is bad UX for the cli, imo.)
Re: Oh shit, git: Getting myself out of bad situations
#397Haha. There should be an entry there for 'Oh shit - I just pushed our private keys to the public github repo'.
If any of those commits with confidential information is reachable from any of those commits, then they'll never be garbage collected from Github.
Re: Oh shit, git: Getting myself out of bad situations
#398Earlier quoted context omitted.
It’s a lot of paperwork to avoid a perfectly safe and normal git command.
To be fair, rebasing a shared branch really isn't all that safe. You can potentially make life hard for a lot of people.
When you say, it’s not safe, it sounds like you could lose work or someone could be hurt, when it’s more likely that the removed ancestors could be merged back in by someone not using ‘git pull —rebase’, or other devs being put out by having to resolve some conflicts. It’s not great, but it’s a far cry from unsafe or DANGEROUS! MUST AVOID! PUBLIC SHAMING!
Re: Oh shit, git: Getting myself out of bad situations
#399Adopted a git GUI years ago and haven't looked back. I get looks sometimes, but I can't help but gloat when I can stage and unstage individual lines in less than a second. I think anyone who uses the CLI is either trying too hard or hasn't realized the beauty of a git GUI. Takeaways: - My commit time is usually much faster than coworkers, with higher accuracy (less frequent accidental commits, etc.) - I don't remembe…
The GUI is said to be a major leap forward in human conputer usage, in the context the CLI just strikes me as either (elitist?) jargon, or brogrammer bravado. In either case, not really a step forward but certain macho. I still don't get it.
Re: Oh shit, git: Getting myself out of bad situations
#400Adopted a git GUI years ago and haven't looked back. I get looks sometimes, but I can't help but gloat when I can stage and unstage individual lines in less than a second. I think anyone who uses the CLI is either trying too hard or hasn't realized the beauty of a git GUI. Takeaways: - My commit time is usually much faster than coworkers, with higher accuracy (less frequent accidental commits, etc.) - I don't remembe…