Setting up an online Git Repository

Two possible alternatives are:

  • Using Atlassian Bitbucket_: it is free for public and private repositories (up to 5 team members), and also supports Mercurial repositories.

  • Using GitHub_: it is free for public repositories

Using Bitbucket

  1. Create a Bitbucket account and a new repository “projectXPTO”

  2. Install Git in your computer and set the global configuration (usig Git Bash):

    $ git config --global user.name "johndoe"
    $ git config --global user.email johndoe@example.com
    
  3. Create a local git repository:

    $ mkdir /path/to/your/project
    $ cd /path/to/your/project
    $ git init
    
  4. Link the remote git repository to your local repository:

    $ git remote add origin https://johndoe@bitbucket.org/johndoe/projectXPTO.git
    
  5. Add a ReadMe file:

    $ echo "# This is my README" >> README.md
    $ git add README.md
    
  6. Commit and push the first change:

    $ git commit -m "First commit. Adding a README."
    $ git push -u origin master
    

Using GitHub

The steps are similar to the ones when using Bitbucket…

  1. Create a GitHub account and a new repository “projectXPTO”

(steps 2 and 3 as above)

  1. Link the remote git repository to your local repository:

    $  git remote add origin https://github.com/johndoe/projectXPTO.git
    

(steps 5 and 6 as above)