Let’s take a scenario. We have already uploaded our rails project to github. Now we want to perform few changes and update the same to our Github repository.
Go through following steps to get access to your git repository & upload the project (with new changes) back to Github.
Open CMD/Terminal window :
# clone the repository, you will get this link just adjancent to your uploaded project in github account.
$ git clone email@example.com:username/reponame.git
#Get inside your project directory
$ cd reponame
#just edit any files inside your project directory. Let’s say we have modified app/controllers/application_controller.rb file.
#review your changes by using following command:
$ git status
#After change just add the modified file to our index.
$ git add app/controllers/application_controller.rb
# I don’t find myself comfortable adding individual file links, no problem we can add our complete directory by using following command.
#make sure you type git space then add then another space then a dot(.)
$ git add .
# Now let’s commit our changes :
$ git commit -m “Performed a commit on 16th Oct 2013”
# Let’s push our clone to remote again.
$ git push origin master
Now just check your repository in your github account and see your repository has been updated with new changes.