-
Build a development system following these instructions.
-
Fork the repository after logging into GitHub by clicking on the Fork button at https://github.com/mbari-org/SeafloorMappingDB
-
Recommended: Generate SSH keys on your development system following the instructions at https://help.github.com/articles/generating-ssh-keys/
-
Rename the existing
origin
remote toupstream
:cd $SMDB_HOME git remote rename origin upstream
-
Assign
origin
remote to your forked repository:git remote add -f origin <your_github_clone_url>
Replace <your_github_clone_url> with "Copy to clipboard" from GitHub web site
Contributing follows a typical GitHub workflow:
-
cd into your working directory, e.g.:
cd $STOQS_HOME
-
Create a branch off of main for the new feature:
git checkout main git checkout -b <my_new_feature>
-
Work on your feature; add and commit as you write code and test it. (Creating a new branch is not strictly necessary, but it makes it easy to isolate the changes from other changes that are to be merged into upstream.)
-
Push the new branch to your fork on GitHub:
git push origin <my_new_feature>
-
Share your contribution with others by issuing a pull request: Click the Pull Request button from your forked repository on GitHub
You should periodically pull changes to your workspace from the upstream remote. These commands will synchronize your fork with upstream, including any local changes you have committed:
git checkout main
git pull upstream main
git push origin
After this you can use the GitHub web interface to visualize differences between your fork and upstream and submit a Pull Request.
If a lot of changes have happened upstream and you have local commits that you have
not made public you may want to do a rebase
instead of merge
. A rebase
will
replay your local changes on top of what is in upstream, e.g.:
git fetch upstream
git rebase upstream/main
or
git rebase upstream/<branch_name>
, if a lot of upstream development is happening on another branch
WARNING: This will rewrite commit history, so should only be done if your local commits have not been made public.