TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Git Internals, Techniques, and Rewriting History

162 点作者 mxschumacher超过 5 年前

13 条评论

aequitas超过 5 年前
My collegae told me I&#x27;m the guy with his phone number in the git.txt file, don&#x27;t know if that&#x27;s a compliment?<p>But whenever I try to explain Git to someone I try to step away from a computer and just work out the problem on a whiteboard. Using post-it&#x27;s for branches&#x2F;HEAD&#x2F;tags and marker to write down the commits and the commit-tree. Preferrably permanent marker to reflect the permanent nature of commits with regards to branches (eg: rebasing keeps the original commits around). Also I ditch files in favor of a picture of a cat there changes are attributes like added body parts or toys since most people like cats better than files.<p>Taking it away from a computer really helps to reduce the complexity involved and thinking about what manipulations you make to the Git &#x27;database&#x27; visually really helps understanding the concepts imho. Just going through it step by step as if you where the Git binary making the changes, and after a while the Git commands turn from hard to remember trivia to tools in your toolbox.
评论 #21312138 未加载
acemarke超过 5 年前
Oh hey, that&#x27;s my post! Glad someone found it interesting enough to submit.<p>Don&#x27;t expect this to hit critical mass by now, but happy to answer questions on the rewriting thing if anyone has any.
评论 #21309725 未加载
评论 #21312049 未加载
评论 #21311949 未加载
评论 #21313685 未加载
pjc50超过 5 年前
I love how the first real slide goes straight into the fake manpage generator: <a href="https:&#x2F;&#x2F;git-man-page-generator.lokaltog.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;git-man-page-generator.lokaltog.net&#x2F;</a><p>&quot;App Repo Size Issues:&quot; yes, this is the Achilles heel. By being a full distributed system where every client has to carry a full copy of the history of everything, some common practices become unsustainable. I&#x27;ve had two employers that checked build artefacts into SVN, for example: do that with git and the repo becomes unusably large very quickly. Vendoring dependencies, a useful practice if your project is slow-moving, will also bloat the repo. They should be using &quot;shallow clone&quot; for Jenkins, but even that can be surprisingly large.<p>I&#x27;ve also been through the &quot;apply BFG to repo&quot; phase (very time-consuming, and blocks all commits while you&#x27;re doing it!)<p>&gt; New idea: run the formatter against every commit in the history, so that it looked as if the code was &quot;always formatted the right way&quot;.<p>This is actually brilliant, for the reason they give - keeping &quot;credit&quot; assigned correctly to original commits.<p>&gt; Determined it was okay if older commits were potentially &quot;broken&quot;, as long as the latest commit runs and has all of our changes as of late 2018<p>I&#x27;m less OK with this, as the chances of an automatically introduced horrible bug which you can&#x27;t trace seem rather high <i>and</i> you&#x27;ve wrecked any chance of using git-bisect! But if the &quot;tip&quot; is the only supported released version, I suppose it&#x27;s less critical.<p>It&#x27;s also interesting that most of the speed issues are addressed by re-architecting to avoid syncing to disk. If there was an easy Windows RAMdisk this might have made almost as much of a difference.
评论 #21313161 未加载
评论 #21313117 未加载
mederel超过 5 年前
The slides don&#x27;t display well on mobile device
评论 #21313071 未加载
评论 #21309911 未加载
darekkay超过 5 年前
I always found &quot;rewriting history&quot; misleading. Git is immutable by default, so you cannot &quot;rewrite&quot; the history. In fact, you are creating an &quot;alternate history&quot; (which the article mentions). While the difference appears subtle, it takes away the fear of users who never use any &quot;altering&quot; commands because they think they might lose their changes or mess up something.
评论 #21311019 未加载
评论 #21311961 未加载
ridiculous_fish超过 5 年前
What are the best practices for extending git? Every example seems to be a shells script that calls out to git; is there a better approach?
评论 #21310086 未加载
评论 #21319244 未加载
评论 #21311155 未加载
评论 #21310093 未加载
评论 #21312040 未加载
mettamage超过 5 年前
I find the diagram on page 15 to get an overall feel&#x2F;flow for basic git usage a very good diagram. If I&#x27;d still be teaching at a coding school I&#x27;d hand it out to my students.
评论 #21310674 未加载
emilfihlman超过 5 年前
Note: the presentation has ui flaws and does _not_ fit on a 3:2 screen, so you&#x27;ll have to zoom to about 80% for it to be visible. This is apparent on slide 8.
dreamcompiler超过 5 年前
Impossible to resize and read on my phone. It amazes me when a developer writes a presentation about a developer tool using a goopy JS-dependent infrastructure that apparently has never been tested on mobile.
评论 #21314573 未加载
rsp1984超过 5 年前
Safari user here. For some reason the navigation arrows are missing and I can&#x27;t get past the first page...
评论 #21313911 未加载
pikzel超过 5 年前
Would have been nice if we could scroll through the pages and not having to use the arrow keys.
samwestdev超过 5 年前
any video archive of the presentation?
评论 #21313078 未加载
dang超过 5 年前
We changed the URL from <a href="https:&#x2F;&#x2F;blog.isquaredsoftware.com&#x2F;2019&#x2F;10&#x2F;presentation-hooks-hocs-tradeoffs&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.isquaredsoftware.com&#x2F;2019&#x2F;10&#x2F;presentation-hooks...</a> to the slides which have the content.
评论 #21309454 未加载