Working with Git

Commit Changes to A New Branch

For example, the current branch I’m working on is named master, and the other branch is named stable.

  1. Run $ git checkout -b stable to switch to the new branch.
  2. Edit files and save.
  3. Run $ git commit <file> -m "sync with master" to commit a single change to your local repo.
  4. Run $ git push origin stable to push the change to the new branch on the Github.

Merge Changes into the Master Branch

The current branch I’m working on is named stable.

  1. Run $ git checkout master to switch to the master branch.
  2. Run $ git merge stable.