This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

init


In this task we will create a new Git repository using init.

The init command is short for initialize. It creates a new repository in the current working directory. Lets give it a try. Change directories to a location where you want to work. You can use any existing directory or create an empty one if you wish.

$ cd /home/username/project
$ git init
Initialized empty Git repository in /home/username/project/.git/

Git settings sub-directory (.git)

The /.git/ directory is a hidden sub-directory where Git stores information about your project such as iterations, remote locations, etc. The structure of the /.git/ directory looks like this:

branches  config  description  HEAD  hooks  info  objects  refs

We will find out more about this directory as we explore Git further.

Task

  • Open the file .git/description
  • Copy and paste the default description text to the discussion area for this task
  • Change the description and include the new description in the task discussion

Further Reading

Git Reference: Init
Git Reference: Creating
 

Task Discussion


  • malicke   Oct. 31, 2012, 2:35 p.m.

    Initial description:

     

    Unnamed repository; edit this file 'description' to name the repository.
     
    New description:
     
    test repository for P2PU
  • Matija Šuklje   Oct. 28, 2012, 11:22 a.m.

    Initial description:

    Unnamed repository; edit this file 'description' to name the repository.
     

    New description:

    Playground repository to play around with while learning how to use Git.

  • nzeribe   July 10, 2012, 6:36 p.m.

     

    "Unnamed repository; edit this file 'description' to name the repository." The new description reads: "Unnamed repository; edit this file 'description' to name the repository. We are learning how to
    use Git at P2PU!"
  • Emily Priddy   June 7, 2012, 12:02 p.m.

    Unnamed repository; edit this file 'description' to name the repository.

  • Crisman Noble   Dec. 27, 2011, 12:47 p.m.

    I got a 404 when I tried to visit the link for "git-init Manual Page" this may be of help to others looking for the manual page: http://linux.die.net/man/1/git-init or http://www.manpagez.com/man/1/git-init/Xcode-4.2.php

  • Brylie Oxley   Dec. 27, 2011, 5:39 p.m.
    In Reply To:   Crisman Noble   Dec. 27, 2011, 12:47 p.m.

    Which link did you try to access? Both of the links in this task work for me.

  • Crisman Noble   Dec. 28, 2011, 3:56 p.m.
    In Reply To:   Brylie Oxley   Dec. 27, 2011, 5:39 p.m.

    I edited the one that didn't work, which was the first one.