Pushing Changes to GitHub

I have repeatedly found myself searching for how to commit changes to an existing repository at github. Despite a huge number of tutorials, articles and other git-related resources it took me a good while to get to the information I needed. Forgetful as I am, I was thinking that posting about it could save me a bit of time. Here is what needs to be done.

cd [your project directory]
git status
git add <any new files>
git commit -a -m "Your comment goes here"
git push origin master

Running git status gives a brief summary on what changes have been made (modified / deleted / non-versioned). Remember, it is the push command which does the job of promoting your changes to the repository. Indeed, to complete the operation the github credentials need to be provided. As a result, you should be able to see the committed changes in your github repository.

Similar Posts