开发者

Basics of version control from a Git(hub) perspective

开发者 https://www.devze.com 2022-12-22 23:48 出处:网络
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.

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.

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 cop开发者_如何学编程ies of a file up to date on different computers. 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. (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. 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? 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/

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. If you know some basic stuff, Chapter 3 may be enough by itself.

If you just want a 15 minute screencast on remote stuff, you can watch this: http://gitcasts.com/posts/distributed-workflow

Scott

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号