Using Git with Remote Repository
By Shay Anderson on January 2014
The following article describes how to use git with a remote repository using Linux/Unix command line (Ubuntu 12.10 in this example).
Install and Configure Git
Start by installing git on your machine if not already installed: # apt-get update
# apt-get install gitTest git version: # git –version
git version 1.7.10.4If you haven’t done already, initialize your git config: # git config –global user.name “[your name]”
# git config –global user.email “[your email address]“You can view config settings using: # git config –list
Use Remote Git Repository
Initialize your local git directory using: # cd /var/www/sandbox/my-git-project
# git init
Initialized empty Git repository in /var/www/sandbox/my-git-project/.git/Next, add the remote repository, for this example I’m using a github.com repository: # git remote add origin https://github.com/shayanderson/test.gitPull the current remote git repository files: # git pull origin masterAdd all the files in your project to the local git repo: # git add .Commit to the local git repo: # git commit -m “Initial dump”And finally push the files to the remote git repository: # git push origin master