📁
EdmundHee
  • Edmund's How to
  • Python
    • Virtual Environment
      • Setup for Windows
      • Setup for Mac
      • How to use VirtualEnvWrapper
  • Git
    • Setup Git Environment
      • Setup Git for Windows
      • Setup Git for Mac
    • Github's How-to
      • Create a repository
      • Repository Branch
      • Update Repository
  • AWS
    • EC2
      • [Raw] EC2 - Recovery Instance
  • Web Development
    • NodeJS
Powered by GitBook
On this page

Was this helpful?

  1. Git
  2. Github's How-to

Update Repository

If there's code change in the project, and you would like to push it to github. Here are some steps to create commit and push the code into github.

Open Command Prompt/Cmder/Terminal, cd to the your project directory. Run the command below to check on any code change inside the project

git status 

You are able to know which branch you are currently in from git status.

If you had created a new file in the project, use git add </path/to/file

Use the following code to create a commit, before pushing the code change to github repository.

git commit -a -m "Message for this commit"

It's advise to provide sufficient information for the commit else you might find it hard to determine which commit to revert.

After creating a commit, we are able to push the commit into github repository with the following command. master branch is created by default, therefore the command below is pushing code to master branch.

git push origin master

origin determines the default location for the cloud repository

PreviousRepository BranchNextEC2

Last updated 5 years ago

Was this helpful?