11 ms·
Learn Enough Git to Be Dangerous
- samstave 11y agoThis is wonderful thank you.
- noer 11y agoI'm a fan of the "Learn Enough..." series. I've found them to be written in a really approachable way, ditto on rails tutorial. Great job!
- mhartl 11y agoThanks!
- breakingcustom 11y agoThere are just some people in this world that have the reputation and thoroughness that makes you only want to learn new things from that one person. Hartl is one of the few. Thanks and can't wait for the rest!
- mhartl 11y agoWow, thanks! Would you mind shooting me an email (address in profile)? I might like to include this comment as part of a testimonial section at some point.
- sotojuan 11y agoThis looks great. Looking forwards to the Ruby one as well. I also saw Elixir in the "Coming Soon" section. What are your opinions on the language?
- mhartl 11y agoI don't know Elixir yet, but I'm collaborating with someone who does. I think the plan is he teaches me, then I teach you. :-) I've heard great things about Elixir, and its design is heavily influenced by Ruby, so I think it will be a natural fit for Learn Enough to Be Dangerous.
- thirdsun 11y agoAdditionally a fully featured Phoenix Tutorial would be very welcome as well - however that's probably a silly thing to suggest if you have to learn Elixir first.
- noer 11y agoOut of curiosity, why do you use suggest using github in this book, but bitbucket in rails tutorial?
- mhartl 11y agoExcellent question. The main reason is that GitHub is great for free public repos, which I generally like having as the default, and using GitHub also enables a Secret Bonus™ at the end of the Git tutorial. When it comes to web apps, though, it's better to err on the side of security, so in that case I recommend using free private repos at Bitbucket. (These choices were made mainly because public repos are free at GitHub and private repos are free at Bitbucket. Both services are great and are definitely worth paying for, but in a free online tutorial I prefer to recommend things that are also free.)
- ryderm 11y agoI can't speak for this book, but Michael Hartl's rails tutorial is what got me addicted to programming, and is largely responsible for me switching majors to CS during my undergrad and getting into the industry. He is a great technical author. Give him your money.
- moomoos891 11y agoI love you Michael Hartl!
- moomoos891 11y agoI love you Michael Hartl!
- mhartl 11y agoI linked to the free online version because that feels like the more HN thing to do, but there's also an announcement post that includes a 15% launch discount on ebook sales: http://news.railstutorial.org/learn-enough-git-ebooks/ http://news.railstutorial.org/learn-enough-git-ebooks/ I'll plan to be around for a bit this afternoon in case anyone has any questions. I've already gotten a lot of great feedback on Learn Enough™ Git to Be Dangerous, so thanks for all the support!
- sytse 11y agoLooks awesome! Thanks so much for making this.
- mhartl 11y agoThanks! By the way, in the collaboration section I wanted to tell people about the option to host their own repos, so of course I put in a link to GitLab: http://www.learnenough.com/git-tutorial#sec-collaborating http://www.learnenough.com/git-tutorial#sec-collaborating
- sytse 11y agoThanks, I put in a link to your tutorial from our /getting-help section https://gitlab.com/gitlab-com/www-gitlab-com/commit/1fef9f12298aa0b505fe62e5066ac2f01b133c44#5991b35fea74c1c45c55c779b359096a2691caa7_37_37 https://gitlab.com/gitlab-com/www-gitlab-com/commit/1fef9f12...
- mhartl 11y agoGreat, thanks! And linking directly to the commit—now that's thinking Git. :-)
- skizm 11y agoWait... The phrase "Learn Enough" is trademarked? Wtf?
- kiddz 11y agoWhy didn't you do a corresponding screencast?
- mhartl 11y agoOh, that's definitely planned. :-) Even better, my Learn Enough to Be Dangerous cofounders and I are working on a subscription service that will integrate text and videos for the command line, text editor, and Git tutorials, with many more to come (including the upcoming 4th edition of the Ruby on Rails Tutorial). See http://learnenough.com/ http://learnenough.com/ to get some idea of what we've got in store.
- BWStearns 11y agoI really like this series because of the focus on developing technical sophistication as opposed to a narrow set of boxes to check. I've shared the enough command line to be dangerous with a friend who has flirted with the technical and I think it helped him develop the meta skill of technical sophistication more than any specific command line skill. It's a greater achievement than him knowing the all the flags for tar, because who does? In any case, looking forward to reading through it and thanks for putting these out there!
- mhartl 11y agoThanks! Developing the theme of technical sophistication has been one of the most surprising and gratifying side-effects of making tutorials designed for complete beginners. I'm hoping to continue the theme in each subsequent Learn Enough tutorial, and I'm thinking of adding it to the next edition of the Ruby on Rails Tutorial as well.
- BWStearns 11y agoPlease do! It really struck me as a theme that I hope grows beyond a Hartl-only concept. It succinctly describes a previously unnamed concept. It's the thing that you want to impart when you get that exasperated feeling trying to explain over the phone to a non-technical friend/relative how to go about fixing something that you yourself don't explicitly know how to fix but could easily if you were sitting at their computer. More broadly have you though about a generic way to achieve/impart technical sophistication intentionally other than as a side effect of getting scraped knees doing technical things?
- mhartl 11y agoMore broadly have you though about a generic way to achieve/impart technical sophistication intentionally other than as a side effect of getting scraped knees doing technical things? I don't think there's any way to avoid getting a few battle scars, but just knowing about the idea of technical sophistication (and having a name for it) turns out to be a huge help, as you observed.
- frozenport 11y agogit push --force?
- dnate 11y agocertainly one of the more dangerous git commands
- brianwawok 11y agoMany (most) people disable -force on key branches, if not they should!
- mhartl 11y agoThe `git push --force` command didn't quite make the cut, but if you can think of a place where it fits into the current tutorial I'm certainly open to adding it. Maybe it fits in as an exercise somewhere? UPDATE: yebyen has suggested this was a meant as a joke. If so—good one! UPDATE 2: I don't mean to imply that force-pushing isn't useful! As several commenters below have noted, it most certainly is. But it's also most certainly dangerous.
- yebyen 11y agoI think that was supposed to be a joke. Enough git to be dangerous... what about some dangerous git command which potentially destroys some important history... [stopgirl.gif] Your books are great, I've been buying Learn Enough to be Dangerous preorders for topics I already know well because I learned so much from the Rails Tutorial dot-org. Thanks!
- mhartl 11y agoHeh, I almost replied that `git push --force` might be a little too dangerous! But the truth is it barely didn't make the cut, and I wouldn't mind finding a place to work it in.
- mmanfrin 11y agoI've seen `git push -f` used quite a bit over my career. Maybe it's bad practice, but it's useful for: 1. Organizations that want single-commit branches (e.g., where there's a lot of cherry picking going on in a git-flow style to get certain features pushed out) but you also want to keep 'savepoint' commits while developing. Squashing a bunch of commits requires a -f if you've already pushed. 2. Rebasing a branch (without making a bubble merge). 3. For truly small quick fixes you notice when you've just pushed to CI (like you left in a debug or a focus on some tests).
- wodenokoto 11y agoI've been looking forward to this one. Learn enough command line to be dangerous is the best beginners guide to bash I've seen and it really made me a lot more comfortable working with cli programs.
- mhartl 11y agoThanks! As the first title in the Learn Enough sequence, Learn Enough™ Command Line to Be Dangerous was especially challenging to write, because it literally assumes no prerequisites other than general computer knowledge (not even a text editor). So glad to hear you liked it!
- sharkjacobs 11y agoI just skimmed the first section of Learn Enough Command Line and discovered you can hold option to use the mouse to insert the cursor in the middle of a line. I thought I knew how to use cli but now I feel like I need to go through this whole tutorial to see what other incredibly obvious things I've been missing.
- collyw 11y agoI would say thats a Unix specific thing more than CLI. It will work on Linux web browsers. Unfortunately three button trackpads seem to be disappearing.
- Freak_NL 11y agoMost Linux distributions by default configure the track-pad to emulate the middle mouse by clicking the left and right button simultaneously. Not as nice as an actual third button, but useful if you are on a laptop without a peripheral mouse attached.
- collyw 11y agoLast couple of laptops I have had were not able to click left and right together. Another one for aesthetics versus usability.
- nanoojaboo 11y agoWhy "Dangerous"? Dangerous to who or what?
- deleted 11y ago[deleted]
- nickjj 11y agoHi Michael, This is the first I've heard of the softcover platform. After some research it looks like it was posted on HN about 2 years ago, but there's only a handful of books posted on the platform compared to let's say leanpub who has a few thousand. Since you just posted this book on softcover, it's safe to say you're still happy using it, but why aren't more authors choosing your platform? You would think after 2 years it would have gained traction, especially considering how big your reach is from previously successful tutorials and books. I'm a content author and softcover looks nice. My main issue with leanpub is that all sales data is anonymous and you can't obtain e-mail addresses of your readers and your platform seems to solve that.
- mhartl 11y agoThanks for the note. Softcover is absolutely amazing for my purposes, but at this point we think the educational market is more promising than the market for self-publishing tools, so that's what we're focusing on now. This was always part of our plan; I personally needed Softcover for the reasons you mention, but it was an open question whether it would take off as a standalone platform or whether we would end up focusing on making our own products. A happy but unintended side-effect of making a platform is that it dramatically lowers the barrier to collaborating with other authors, and I'm currently working with several other people on more advanced and varied Learn Enough tutorials. This sort of collaborative publishing (with full control over the publication pipeline) would be effectively impossible without Softcover.
- nickjj 11y agoI see, thanks for the reply. So basically you've been spending your time and resources on creating the books rather than promoting the platform? I will certainly reach out to you in the future because having access to e-mails is enough to move me off leanpub. In leanpub's defense they are a great bunch of people. I've had a number of conversations with their developers and they are always on the ball. Also never had any technical issues with their platform as an author.
- mixmastamyk 11y agoHmm, both services look nice but don't appear to support Sphinx. Would that be a possibility at some point?
- jeffwass 11y agoNice logo!
- Anjin 11y agoThanks! There's also another variant that I created that we are using for our beta testing "Special Ops" team signup page: http://www.learnenough.com/special-ops http://www.learnenough.com/special-ops
- gerbilly 11y ago>Learn Enough Git to Be Dangerous $ git init
- deleted 11y ago[deleted]
- juped 11y agoNothing in git is dangerous except push. This book advocates pushing quite often, making its title pretty accurate. :)
- hvis 11y agogit reset --hard
- slavik81 11y agoGenerally recoverable by checking git reflog and doing another git reset --hard back to how it was before. git clean -dfx is the most probable way for me to delete something that I never committed.
- hvis 11y agoYou missed the point of the '--hard' argument. It destroys the local, uncommitted changes. That can be much scarier than 'git push -f'.
- slavik81 11y agoApparently we both need to write better, because you missed the point of my example. Most—if not all—local changes that would be destroyed by git reset --hard show up in git status. git clean -dfx will wipe out ignored files, which do not show up in git status, so it's much easier to forget about something you meant to keep.
- hvis 11y agoI've never used 'git clean -dfx' routinely during development. On the other hand, I've seen a colleague lose a few hours' work by forgetting to commit a specific file out of a set, and then doing 'git reset --hard' for some reason. 'git status' didn't save him. Luckily, he did commit the corresponding tests file.
- nickpsecurity 11y agoA previous thread and its uptake in FOSS showed I really need to get a grasp on Git soon. I'm more about practice than theory so I certainly liked this line: "focuses on Git essentials without getting bogged down in lots of heavy theory." Bookmarked it for later when I tackle that. Thanks ahead of time for writing and sharing it.
- dEnigma 11y agoThe initial delay when opening the site, before the text appears below is very confusing, at least to me. I didn't know if I was supposed to click on something and tried scrolling up and down to trigger something. The delay lasted more than five seconds on first load and about 3-4 seconds on reloads (could be a problem on my end too).
- randiLee 11y agoThis is great, thanks.
- dave2000 11y agoIs there supposed to be a free book here? The page doesn't work on mobile; I zoom in and a rectangle on the left pointlessly expands, covering the screen.
- dave2000 11y agoI've whitelisted all the JavaScript on the site and now an additional annoying box with "keep in touch" is floating over the centre of the page, and if I scroll the page underneath up and down so that the box doesn't cover it I can see "content not available". Is this your first site?
- jakub_g 11y agoThis series looks very interesting and hitting the sweet spot with high knowledge density while still being casually readable. Very nice of the author to put stuff on the website without the paywall. Two semi-related links (though much different, focusing mostly on syntax): https://learnxinyminutes.com/ https://learnxinyminutes.com/ http://hyperpolyglot.org/ http://hyperpolyglot.org/