Using Git and GitHub on Ubuntu

From RobotForAll
Jump to: navigation, search

Install Git for Linux

$ sudo apt-get install git

Sign up GitHub account

Configure GitHub settings

$ git config --global "username"
$ git config --global "email address"

Create a local repository (test)

$ git init test

Create a test file in the local repository

$ cd test
$ gedit

Add repository files to an index

$ git add
$ git add --all (add all folders and files)

Commit changes made to the index

$ git commit -m "description message"

Create a repository on GitHub

Set the remote GitHub repository

$ git remote add origin

Pushing files in local repository to GitHub

$ git push origin master

Clones a repository to your computer

$ git clone

Fetches updates made to a remote repository

$ git fetch remotename

Merges updates made online with your local work

$ git merge remotename/branchname

Grabs online updates and merges them with your local work

$ git pull remotename branchname


Further readings