Upload to GitHub

Let’s just imaging simple task: to upload all your files from ‘working_folder’ to your repository on github. Here are steps which you should fulfil:

-install git on your local PC

$ sudo apt-get update
$ sudo apt-get install git

-configure Git

$ git config --global user.name "User Name"
$ git config --global user.email "useremail@mail.com"

-create local repository

$ cd /...full path.../working_folder
$ git init

on this step  .git folder is created inside the  working_folder

-add all files from working_folder to local repository

$ git add *
$ git commit -m 'some message'

-create repository on github which would be remote for us
Let’s asume that you have been registered on GitHub under the name ‘my_name’  and you have created repository ‘my_repository’.

-connect  local repository to the remote  one on github
By default we are on master branch

git remote add origin https://github.com/my_name/my_repository.git
git push -u origin master

Leave a Reply

Your email address will not be published. Required fields are marked *