Posted by: rakitha | February 28, 2011

Creating Repositories in GIT for the First Time

First create a public account in the git. Before you create any repositories in the git, ssh key must be generated and uploaded in to the git. Since the git has a nice entry about how this can be done I will simply point to that link. The main point is not to create any repositories before finishing,

  1. Generating a ssh key
  2. Add the key to the git account you just created.
  3. Once this is done, you are ready to create your first repository
  4. Once you done that try
    ssh git@github.com

    , you should see

    Hi [user]! You've successfully authenticated, but GitHub does not provide shell access.
             Connection to github.com closed.

Creating a repository is very simple first create it in the github. Follow the instructions given in the How-to. Once you done that you could link a new directory and add stuff into that or link existing source code library. The instructions given in the above link are given for creating a new directory.

To create repository with your existing code, go to the directory where you have your stuffs and follow these steps,

  1. cd
    
    [/source]
  2. git init
  3. git add [file1]...[file n]
  4. git commit -m 'first commit'
  5. git remote add origin git@github.com:[git-username]/[git-repository-name].git
  6. git push origin master

To Commit Changes

  1. git commit file-name
  2. git push origin master
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: