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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

GitHub Cheat Sheet

193 点作者 jlemoine大约 11 年前

14 条评论

holman大约 11 年前
As mentioned, these are cribbed from my Git &amp; GitHub Secrets talk: <a href="http://zachholman.com/talk/git-github-secrets/" rel="nofollow">http:&#x2F;&#x2F;zachholman.com&#x2F;talk&#x2F;git-github-secrets&#x2F;</a><p>If you&#x27;re interested in the arcane side of Git and GitHub, you might also be interested in the follow-up talk I&#x27;ve given a few times the last half-year or so, which details a bunch of other new things: <a href="http://zachholman.com/talk/more-git-and-github-secrets/" rel="nofollow">http:&#x2F;&#x2F;zachholman.com&#x2F;talk&#x2F;more-git-and-github-secrets&#x2F;</a><p>I&#x27;m more of a fan of the second talk, myself. My favorite thing I discovered while making the second talk was the &quot;second-order-diff Git trick&quot;, which Tom Moertel came up with here: <a href="http://blog.moertel.com/posts/2013-02-18-git-second-order-diff.html" rel="nofollow">http:&#x2F;&#x2F;blog.moertel.com&#x2F;posts&#x2F;2013-02-18-git-second-order-di...</a>
CyberShadow大约 11 年前
&gt; Adding `#L52` to the end of a code file URL will highlight that line number.<p>You can click the line number (in the column to the left of the code) to add the fragment to the URL, and Shift+click to select a range. Easier than editing the URL directly.
评论 #7581984 未加载
daGrevis大约 11 年前
One shouldn&#x27;t alias &#x27;git add . &amp;&amp; git commit&#x27; to &#x27;git ac&#x27;. You should always check what you are about to commit with &#x27;git status&#x27; and &#x27;git diff&#x27;.
评论 #7580861 未加载
评论 #7580887 未加载
jballanc大约 11 年前
One that&#x27;s missing that I&#x27;ve found rather useful: add &quot;.pibb&quot; to the end of any Gist URL to get the &quot;HTML Only&quot; version suitable for embedding in any other site. Time was, before a lot of blogging engines had GitHub integration, this was the best way to get code on your blog.
评论 #7586653 未加载
评论 #7583592 未加载
canadev大约 11 年前
Interesting, I like the &quot;git status -sb&quot; (short, show branch tracking info) command. The query one seems a lot like &quot;git grep&quot; to me, I am not sure I understand the difference.<p>The specified &quot;git ac&quot; alias (git add . &amp;&amp; git commit) is bad news, in my book. I&#x27;ve seen people accidentally commit extra files using &quot;git add .&quot; .<p>I much prefer &quot;git add -p&quot; for tracked files; the git tab completion for the shell seems to be pretty good about picking up untracked files using &quot;git add &lt;TAB&gt;&quot; as well. (<a href="https://github.com/git/git/tree/master/contrib/completion" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;git&#x2F;git&#x2F;tree&#x2F;master&#x2F;contrib&#x2F;completion</a>)
评论 #7580663 未加载
lubomir大约 11 年前
Could someone give me a usecase for when an empty commit might be useful?
评论 #7580873 未加载
评论 #7580840 未加载
评论 #7580868 未加载
评论 #7581277 未加载
评论 #7582831 未加载
Myrmornis大约 11 年前
<i>Gists are an easy way to work with small bits of code without creating a fully fledged repo</i><p>What is the disadvantage of working with a &quot;fully fledged repo&quot;? Gists unecessarily fragment git workflows. For example, how do I convert my work (a git repo like all projects) into a gist? gists should have been designed as an alternative way of viewing repos, not as a slightly different species of repo.
sampo大约 11 年前
&gt; <i>&quot;To see all of the shortcuts for given page type shift+?&quot;</i><p>Actually just ? suffices.<p>Source: the list of shortcuts shown by typing ? on a GitHub page.
评论 #7581654 未加载
评论 #7581836 未加载
lelandbatey大约 11 年前
Something also to know is there are multiple ways to embed images in wiki pages. There&#x27;s the standard Markdown syntax, but there&#x27;s also a syntax that allows things like specifying the height or width of the image. Example:<p><pre><code> [[ image location | height = 300px ]]</code></pre>
评论 #7586778 未加载
jdkanani大约 11 年前
`git instaweb` is also one of great secrets of Git that GitHub uses very effectively.
评论 #7581906 未加载
davej大约 11 年前
I alias `gti` -&gt; `git`. I&#x27;m always mistyping it, not sure why.
评论 #7580998 未加载
评论 #7580965 未加载
评论 #7582277 未加载
mrfusion大约 11 年前
I&#x27;d like to get more comfortable handling pull requests. Any tips on that?<p>Any time my project gets one I panic :-(
评论 #7581878 未加载
评论 #7585055 未加载
nroose大约 11 年前
I&#x27;m digging hub! Thanks for the link to the cheat sheet.
iancarroll大约 11 年前
Git.io looks really cool. Didn&#x27;t know that existed!