-
Notifications
You must be signed in to change notification settings - Fork 8
How to commit and push changes from your branch back to the Github NOAA_3drtma repository
EdwardColon-NOAA edited this page Jul 24, 2019
·
1 revision
Once you have completed your work on your branch, or you need to prepare for a production switch or other machine downtime, you will need to commit and push your changes back to the EMC Github repository.
Your first step will be to commit the changes in your branch to the local repository.
Git requires that all changes be staged for commit. This can be done using the git add command on the modified files, or using the -a option while using git commit.
Github keeps track of changeset revisions, but not which branch was modified in a given revision. With this in mind, please make sure that you add the branch-name and issue number in every commit message:
git commit -a -m "branch-name: This commit refs #XXXXX. Insert commit message here"
Now, you can push the committed changes from your local repository back to VLab using:
git push origin branch-name
All of your changes are now in VLab, so you can move to another machine and continue working without any issues
Edit this section Example of committing and pushing changes
I have made changes to my branch, tutorial_branch, I would like to push these changes back to VLab.
First, I commit my changes in my branch to my local repository:
[Michael.Lueken@g10a1 ProdGSI]$ git commit -a -m "tutorial_branch branch: This commit refs #40800. Made small modification to README.cmake"
[tutorial_branch c2c7f9d] tutorial_branch branch: This commit refs #40800. Made small modification to README.cmake
1 files changed, 1 insertions(+), 1 deletions(-)
Now that my work is committed, it is time to push this back to VLab:
[Michael.Lueken@g10a1 ProdGSI]$ git push origin tutorial_branch
Counting objects: 5, done.
Delta compression using up to 32 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 371 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2)
remote: Processing changes: refs: 1, done
To gerrit:ProdGSI
* [new branch] tutorial_branch -> tutorial_branch