diff --git a/_layouts/reference.html b/_layouts/reference.html index 305df02..beebc53 100755 --- a/_layouts/reference.html +++ b/_layouts/reference.html @@ -33,19 +33,17 @@ -
My name is Scott Chacon. I am a - software developer, - Git evangelist, speaker, - writer, - world traveler, - father, husband, cat rescuer, baby signer - and gorilla tamer. - Not neccesarily in that order.
-This is my little bit-box on the web where I put - stuff that people for some inconceivable reason - might want to find out about me.
-I work at GitHub. And it is awesome.
- -Some other interesting things I've done: -
If you would like to know any more about any of these, please find me - at a GitHub drinkup in your area, I'll tell you all about them.
- -I am a Git evangelist and Ruby - developer working on GitHub.com. - I am the author of the Pro Git book - by Apress, the Git Internals Peepcode PDF - as well as the maintainer of the Git homepage - and the Git Community Book. - I have presented at a bunch of conferences - and a number of local groups and have done corporate training on Git - across the country.
- -This site is built using the Jekyll library and hosted on GitHub. - The source code used to create this library is publicly available on - GitHub as well.
-The Git Reference site was put together by the GitHub + team.
+ something +
++ In order to do anything in Git, you have to have a Git repository. This + is where Git stores the data for the snapshots you are saving. +
+ ++ There are two main ways to get a Git repository. One way is to simply + initialize a new one from an existing directory, such as a new project or + a project new to source control. The second way is to clone one from a + public Git repository, as you would do if you wanted a copy or wanted to + work with someone on a project. We will cover both of these here. +
git init
in that directory. For example,
+ let's say we have a directory with a few files in it, like this:
+
++$ cd konichiwa +$ ls +README hello.rb ++ + This is a project where we are writing examples of the "Hello World" + program in every language. So far, we just have Ruby, but hey, it's + a start. To start version controlling this with Git, we can simply + run
git init
.
+
++$ git init +Initialized empty Git repository in /opt/konichiwa/.git/ ++ + Now you can see that there is a
.git
subdirectory in your
+ project. This is your Git repository where all the data of your
+ project snapshots are stored.
+
++$ ls -a +. .. .git README hello.rb ++ + Congratulations, you now have a skeleton Git repository and can start + snapshotting your project. + +
+ If you need to collaborate with someone on a project, or if you want to
+ get a copy of a project so you can look at or use the code, you will
+ clone it. You simply run the git clone [url]
command with
+ the URL of the project you want to copy.
+
[example]+ +
+ This will copy the entire history of that project so you have it locally
+ and it will give you a working directory of the main branch of that project
+ so you can look at the code or start editing it. If you change into the
+ new directory, you can see the .git
subdirectory - that is
+ where all the project data is.
+
[example]+ +
+ By default, Git will create a directory that is the same name as the + project in the URL you give it - basically whatever is after the last slash + of the URL. If you want something different, you can just put it at the + end of the command, after the URL. +
+ +