GitHub url: https://github.com/
JCSDA-Internal: https://github.com/JCSDA-internal
JCSDA-Core: https://github.com/JCSDA-internal/JCSDA-core
Table of Contents |
---|
Information on how to get GitHub set up as a new employee can be found at the JCSDA-Core Onboarding Wiki. If you are so new and cannot see this page yet, your team lead will need to add you to the JCSDA-internal and JCSDA repositories.
When contributing to a JCSDA repository, you will clone the repo and create a branch with your changes. Then issue a Pull Request (PR) with at least 2 reviewers before it can be merged back into the develop branch. This section contains a simple outline of the commands used to do that. More information can be found in the JEDI documentation Best Practices for Developers.
To clone a repository (if not already done so): git clone https://github.com/JCSDA-internal/<repo_name>
To check which branch you are on: git branch -a
git checkout -b feature/<branch_name>
git status
git add --all
git commit -m "add description of change here"
git push -u origin feature/<branch_name>
Other useful commands:
git stash
git stash list
git stash apply stash@{2}
git diff path/to/filename
git restore path/to/filename
git restore .
Before doing a JEDI build or development, it is a good idea to set up your GitHub credentials. This can be done by following this section in the JEDI documentation.
Common pitfall: one of these sets of commands is NOT the same as the others! The last command is missing git submodule update --recursive
git clone -b release/1.4.0 --recursive https://github.com/jcsda/spack-stack git clone -b release/1.4.0 https://github.com/jcsda/spack-stack cd spack-stack git submodule update --init --recursive git clone --recursive https://github.com/jcsda/spack-stack cd spack-stack git checkout origin/release/1.4.0 |
git status
shows changes in submodules, even if nestedIn top-level repository, after
git remote update && git [pull|checkout] remote-name[/]develop |
This forwards all submodules recursively to the heads of the branches in (each of the) .gitmodules (files):
git submodule update --recursive --remote |
Should not be needed, because
git submodule update --recursive |
achieves the same if code is committed correctly, plus it doesn’t break (nested) submodules where fixed hashes are used
If really needed use explicitly for individual submodules:
git submodule update --recursive --remote submodule-name |