简体   繁体   English

从Git(hub)角度看版本控制的基础

[英]Basics of version control from a Git(hub) perspective

I learned of gist.github.com from Mozilla Ubiquity , and have been using it to post small stuff I've written , and to keep it updated in a public place, with version control so no information is lost. 我从Mozilla Ubiquity中学到了gist.github.com,并一直使用它发布我写的小东西 ,并通过版本控制在公共场所进行更新,因此不会丢失任何信息。

I understand the basic idea of version control, but I don't know how to use it in a practical sense. 我了解版本控制的基本概念,但是我不知道如何实际使用它。 I've tried reading through tutorials and stuff, but I still don't "get" it. 我已经尝试通读教程和相关内容,但是我仍然没有“理解”它。

I'm sick of using diff utilities to manually keep different copies of a file up to date on different computers. 我讨厌使用diff实用程序手动将文件的不同副本保持在不同计算机上的最新状态。 I like the idea of having a directory on my computer that's versioned, and only updating the public version when I have it in a form that other people can comfortably use. 我喜欢这样的想法,即在我的计算机上有一个已版本化的目录,并且仅当我以其他人可以轻松使用的形式拥有该公共版本时,才更新公共版本。 But, uh... how do I do that? 但是,呃...我该怎么做? They give a public clone URL and a private clone URL. 它们提供了公共克隆URL和私有克隆URL。 (What's the difference?) I've figured out that typing git clone git://gist.github.com/285330.git gist-285330 will copy the latest files from the Gist into the local directory gist-285330 , as well as creating the .git folder with all the previous version information. (有什么区别?)我发现输入git clone git://gist.github.com/285330.git gist-285330会将最新的文件从Gist复制到本地目录gist-285330以及使用所有以前的版本信息创建.git文件夹。 So I can edit the files in my own directory and use them, and then somehow keep track of the versions, and somehow upload the changes back to the site so that other people can see them? 因此,我可以在自己的目录中编辑文件并使用它们,然后以某种方式跟踪版本,并以某种方式将更改上传回站点,以便其他人可以看到它们?

Is it possible to do this with Gist, or should I create a real Github repository? 可以通过Gist做到这一点,还是应该创建一个真实的Github存储库? In either case, how do I actually use it? 无论哪种情况,我该如何使用呢? All the tutorials I've seen assume prerequisite knowledge about "pushing", "committing" and other things I have no experience with. 我看过的所有教程都假定您具有“推”,“提交”和其他我没有经验的先决条件知识。

There is an online Git book here: http://progit.org/book/ 这里有在线Git书籍: http//progit.org/book/

If you read Chapters 2 & 3, it shouldn't take you too long and it should give you all the basic information that you need to know to use Git pretty thoroughly. 如果您阅读了第2章和第3章,它应该不会花费您太多时间,它应该为您提供了全面使用Git所需的所有基本信息。 If you know some basic stuff, Chapter 3 may be enough by itself. 如果您了解一些基本知识,那么第3章本身就足够了。

If you just want a 15 minute screencast on remote stuff, you can watch this: http://gitcasts.com/posts/distributed-workflow 如果您只想进行15分钟的远​​程内容截屏,可以观看以下内容: http : //gitcasts.com/posts/distributed-workflow

Scott 斯科特

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM