The first lesson in [1] explains how to setup github in your machine. In the second lesson I am going to talk about committing local changes into a git hub repo.
1. Create a new git hub repo
Consider git repo name as workrepo.Then go to the directory using the command prompt which you want to commit to git hub.
cd /home/workspace
Execute following commands.
touch README.md – To add a Readme file
git init
git add README.md – To add Readme file in order to commit
git commit -m “first commit”
git init
git add README.md – To add Readme file in order to commit
git commit -m “first commit”
To add the earlier created repo which is workrepo, execute the following command giving your UserName.
Give your github user name and password in order to proceed.Check the github repo for Readme file. The file must be committed to the repo.To add a folder or a file, follow the below commands hereafter.
git add FolderName/FileName
git commit -m “Any comment”
git push -u origin master
git commit -m “Any comment”
git push -u origin master