How to Make Changes to a Branch on Github - caihackathon/facer GitHub Wiki
If you already have a local branch that is tracking/associated with the remote branch that you want to change, skip to step 2. Otherwise, do the following to create a local branch that tracks the Github branch:
git branch -a to list all branches, local and remote. Identify the remote branch you want to change.
git branch <local_branch_name> origin/<remote_branch_name> to create a local branch that is tracking the remote branch.
git branch will list all local branches -- you should see your new local branch
git checkout <local_branch_name> to make the branch you want to change the currently checked out branch.
git checkout -b <your_private_copy_branch> <local_branch_name> You don't want to change the local branch that is tracking the remote branch directly. Creating your own private version of this local branch will make it much safer to address any conflicts later when you try to merge your changes into <local_branch_name>
So at this point, <your_private_copy_branch> is checked out.
Create new files and modify files in your private branch as necessary.
git add . or git add <actual_file_name> to stage the new and modified files in your private branch.
git commit -m "message describing the modifications" to commit the changes to your private branch.
At this point, <your_private_copy_branch> is committed. You could switch to a different branch and work on changes there -- without any confusion. But don't switch branches yet.
git checkout <local_branch_name>
git pull to pull any changes made to this branch by other people while you were making your changes.
git merge <your_private_copy_branch> to merge your private branch to the local branch.
Resolve any conflicts that were reported.
git push to push your <local_branch_name> committed changes to GitHub.