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
Create a Bitbucket account and a new repository “projectXPTO”
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
Create a local git repository:
$ mkdir /path/to/your/project $ cd /path/to/your/project $ git init
Link the remote git repository to your local repository:
$ git remote add origin https://johndoe@bitbucket.org/johndoe/projectXPTO.git
Add a ReadMe file:
$ echo "# This is my README" >> README.md $ git add README.md
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…
Create a GitHub account and a new repository “projectXPTO”
(steps 2 and 3 as above)
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)