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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Git concepts simplified

244 点作者 whiteshadow超过 11 年前

26 条评论

stormbrew超过 11 年前
A suggestion for anyone hoping to write accessible tutorials:<p>&gt; Hg folks should read this section carefully. Among various crazy notions Hg has is one that encodes the branch name within the commit object in some way. Unfortunately, Hg&#x27;s vaunted &quot;ease of use&quot; (a.k.a &quot;we support Windows better than git&quot;, which in an ideal world would be a negative, but in this world sadly it is not) has caused enormous takeup, and dozens of otherwise excellent developers have been brain-washed into thinking that is the only&#x2F;right way.<p>If this is one of the most important concepts, starting it off with a slew of negativity about things the reader may be currently using (windows, hg) is probably not the best way to get them to keep reading.
评论 #6452886 未加载
tootie超过 11 年前
There is an inverse relationship the number articles title &quot;x explained simply&quot; and the actual simplicity of x. I honestly don&#x27;t understand why the developer community refuses to admit the obvious that git is unholy clusterfuck of a product. It has a nice data structure inside it? Name another end-user product for which you are even vaguely aware of what data structures were used.
评论 #6451748 未加载
评论 #6451110 未加载
评论 #6451061 未加载
评论 #6453260 未加载
评论 #6452973 未加载
评论 #6451988 未加载
WestCoastJustin超过 11 年前
Gitolite (where this is hosted) is actually pretty cool too. For those who don&#x27;t know what gitolite is, it is software to works in tandem with git-daemon, that basically allows you to run a centralized git sever with access rules.<p>I created a screencast about it @ <a href="http://sysadmincasts.com/episodes/11-internal-git-server-with-gitolite" rel="nofollow">http:&#x2F;&#x2F;sysadmincasts.com&#x2F;episodes&#x2F;11-internal-git-server-wit...</a>
评论 #6452086 未加载
评论 #6452303 未加载
tekp2超过 11 年前
I was expecting this: <a href="http://tartley.com/?p=1267" rel="nofollow">http:&#x2F;&#x2F;tartley.com&#x2F;?p=1267</a>
评论 #6451944 未加载
评论 #6450855 未加载
lisper超过 11 年前
Great article. Just one rather glaring omission: only a single mention of the index, and that only in passing. I have used git for years, and I still don&#x27;t understand what the fleeping index is supposed to be for. What can you do with the index that you can&#x27;t do with a branch? And why is it called the index? (And why is it git add -a but git commit -A? Or maybe it&#x27;s the other way around?)
评论 #6454362 未加载
aeon10超过 11 年前
There seems to be ALOT of &#x27;Git Explained&#x27; stuff. The best way to learn Git in my opinion is start using it! Google stuff as you go.
评论 #6451367 未加载
评论 #6450726 未加载
评论 #6451199 未加载
dcre超过 11 年前
I love Git, but I&#x27;m pretty sure there&#x27;s no way to explain it simply.
评论 #6451069 未加载
评论 #6450677 未加载
评论 #6451179 未加载
评论 #6452027 未加载
andrewflnr超过 11 年前
This has been danced-around in the comments, so I&#x27;m just going to say it: I don&#x27;t need the concepts of git simplified, I need a better explanation of how git&#x27;s bizarre command set maps onto the obvious DAG&#x2F;filesystem operations.
评论 #6455047 未加载
Pxtl超过 11 年前
... that is not simple. But I&#x27;m figuring it out anyways.<p>I commit my changes to my own repo and keep building changes under HEAD, committing as I go. If I get a branch from a buddy and I want to add it to my code, I either merge or rebase depending how I want his commits to be intertwingled.<p>Because GIT is decentralized, there&#x27;s no difference between merging in a buddy&#x27;s branch, and import the latest changes from Origin into my branch. So I fetch the changes from origin&#x2F;master and then rebase or merge my repo on top of that. That&#x27;s my &quot;Get Latest&quot; command, basically, right? Assuming I&#x27;m working on &quot;master&quot;, I fetch then rebase or merge origin&#x2F;master.<p>To check in, I tell the origin server to take <i>my</i> stuff and then rebase or merge its master with that.<p>I still feel like this is a rather baroque approach to the problem... managing oodles of local commits separate from rebase&#x2F;merges seems bizarre, above and beyond the decentralized approach that makes my own repo, my peer, and the &quot;origin&#x27;s&quot; stuff all equivalent.<p>The decision of when to merge vs. rebase is still confusing to me.
评论 #6454669 未加载
评论 #6452614 未加载
评论 #6452545 未加载
0xdeadbeefbabe超过 11 年前
It&#x27;s possible, at least after I see the concepts this way, that git has the simple design Hoare was talking about when he said:<p>“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” ― C.A.R. Hoare
b0z0超过 11 年前
Very nice, and to see it in action, this is also really cool: <a href="http://pcottle.github.io/learnGitBranching/?demo" rel="nofollow">http:&#x2F;&#x2F;pcottle.github.io&#x2F;learnGitBranching&#x2F;?demo</a>
forrestthewoods超过 11 年前
If your &quot;simple&quot; explanation of how to use something is 27 pages then it is many things and simple isn&#x27;t one of them.<p>My favorite thing about Git is how it&#x27;s forced Perforce to add features and lower price. Thanks Git!
bb0wn超过 11 年前
I found the git book to be more than adequate enough for explaining the structures and practice patterns of git.<p><a href="http://git-scm.com/book" rel="nofollow">http:&#x2F;&#x2F;git-scm.com&#x2F;book</a>
pessimizer超过 11 年前
This did it for me: <a href="http://www.sbf5.com/~cduan/technical/git/" rel="nofollow">http:&#x2F;&#x2F;www.sbf5.com&#x2F;~cduan&#x2F;technical&#x2F;git&#x2F;</a>
acqq超过 11 年前
I don&#x27;t use Git and would like to know how the following problem is solved in Git.<p>Say you have a project which is a hundred megabytes big. And you have to develop almost in parallel three or four &quot;generations&quot; of the project -- let&#x27;s say. v1, v2 and v3. In parallel means you&#x27;d like to be able to build any of the three versions without having to take the version out of the repository first. You can&#x27;t say that v1 is obsolete, as soon as some bugs are reported in v1 you have to fix them in v1, v2 and v3. And every bigger version is &quot;newer&quot; but some features can be added in v2 and v3 some just in v3 etc.<p>How can you work on such a big project and have a single repository where all three versions are present, and work on these three versions in parallel (having sources which are compiled in different base directories)?
评论 #6453924 未加载
评论 #6454209 未加载
评论 #6453887 未加载
评论 #6454766 未加载
anandabits超过 11 年前
This is very nice as a review of Git, but probably best in that context rather than an initial presentation of the concepts. I really enjoyed the Source Control Made Easy series by Jim Weirich. It presents the same information in an easily digestible, step-by-step approach. Highly recommended for those trying to understand how Git works and how to best make use of it.<p><a href="http://pragprog.com/screencasts/v-jwsceasy/source-control-made-easy" rel="nofollow">http:&#x2F;&#x2F;pragprog.com&#x2F;screencasts&#x2F;v-jwsceasy&#x2F;source-control-ma...</a>
wiremine超过 11 年前
Git&#x27;s learning curve feels similar to the learning curve of a programming language like Python.<p>Once you understand you&#x27;re not going to pick it all up in an afternoon (just like a language) and that there will be lots more to learn down the road (like a language), git feels great.
评论 #6454178 未加载
评论 #6453815 未加载
Sir_Cmpwn超过 11 年前
It&#x27;s the stuff behind the curtain that makes me love git. It doesn&#x27;t just seem like version control software - it seems like the software is an interface to a much more powerful version control <i>engine</i>. Git just makes <i>sense</i> under the covers.
delinka超过 11 年前
See also Git for Computer Scientists at <a href="http://eagain.net/articles/git-for-computer-scientists/" rel="nofollow">http:&#x2F;&#x2F;eagain.net&#x2F;articles&#x2F;git-for-computer-scientists&#x2F;</a>
gbog超过 11 年前
Nice. I&#x27;d love to see more details about the index, the way to see differences between branches with log and diff, and I think stash should be mentioned.
mrcactu5超过 11 年前
<p><pre><code> git init git add . git commit &quot;:-)&quot; git push origin master </code></pre> 6 months later I still look it up... this tutorial is for me!
jheriko超过 11 年前
a lot of this is generally (d)vcs and applies equally to mercurial or even svn...<p>also if you think x pages of anything is a simple explanation then you missed a trick or two.<p>e.g if you have to explain why your arrows are pointing backwards you are doing it wrong, instead of using the standard notation for graphs and lists and stuff which are not generally well known, use what most people will understand on inspection.
obilgic超过 11 年前
Can someone please convert this into a nice pdf? Chances are I will do this type of reading when I am offline...
ezrasuki超过 11 年前
Yeah right.
Jugurtha超过 11 年前
I prefer the Fox News tutorial on the subject.<p>&#x27;Repo&#x27; means &#x27;reciprocity&#x27; or &#x27;reposotory&#x27; if you didn&#x27;t know.
评论 #6452515 未加载
评论 #6452062 未加载
btbuildem超过 11 年前
The 90&#x27;s called, they want their bitmaps back..