Configure Git

You need to configure Git only once per user per computer (with the --global option).

git config --global "John Doe"
git config --global ""

Clone a repository to your local machine

On YouSource, first browse to your repository. There you can find two cloning urls. One of them allows only cloning and pulling (read-only) and the other one allows pushing as well (read and write).
For example:

git clone your_repo      # Read and write
cd your_repo

After you have cloned your repository, the url is automatically stored and you can refer to it by the name origin when using such Git commands as push or pull.
Tip: Read-only urls always start with 'git://' and read and write urls start with 'git@'.

Add an existing (local) project under Git repository

cd /path/to/your/project
git init .                                     # Initialize a Git repository  
git add .                                      # Add all your project files  
git commit -m 'Describe your changes shortly'  # Store a version of your project locally

Make your local repository track a repository on YouSource

To make your local repository track your repository on YouSource you can give it a name with which you can refer to it. Often the name is origin which is assumed for example when you clone.

git remote add origin

After this you can refer to your repository on YouSource as origin.

Push your local repository to YouSource

Push your local ‘master’ branch to your repository on YouSource:

git push origin master

Push all your local branches to YouSource:

git push --all origin

You can push even if the repository doesn’t exist on YouSource. Then it will created! Project is also created if it doesn’t exist already. When you create a repository by pushing, the name of the repository is defined in the url.
Here is an example:

git remote add origin
git push origin master

Update local repository from repository on YouSource

There are two commands which to use to get updates from a repository on YouSource. They are git fetch and git pull.
The command git fetch updates your local repository’s list of remote branches and downloads branch data. It doesn’t do anything to your local branches though.
The command git pull fetches data for the current branch from the remote repository and merges it to your current local branch.

Update local repository from remote repository called origin:

git fetch origin   # This doesn't change your local branches

Update current local branch from remote repository called origin:

git pull origin master  # Update local branch 'master' from remote branch 'master'

Manage remotes

References to remote repositories are called remotes. Your local repository can track multiple remote repositories.

Display list of remotes:

git remote

Track another remote repo and set ‘second_origin’ as its name:

git remote add second_origin git://

Change the url for a remote:

git remote set-url second_origin

Rename a remote:

git remote rename second_origin temp_origin   # Rename 'second_origin' to 'temp_origin'

Remove a remote (doesn’t remove the repository itself of course):

git remote rm temp_origin

Further reading

Pro Git to learn basics and more
Git Reference to get hold of basic commands