5. Command Cheat Sheet
This is strictly a reference document - the following commands do not define a specific process.
5.1. Git
This is a selection of Git commands most useful for working with dvmdostem. For more thorough coverage, visit the Git documentation: https://git-scm.com/doc
5.1.1. Status
These commands print information to the console and change nothing.
|
See the current state of your local repository |
|
List all local branches, including the active one |
|
List all remote branches |
|
List all remote repositories |
5.1.2. Branch Management
|
Create a new branch |
|
Check out a remote branch |
|
Force a new local branch to track a remote branch |
|
Move to another branch |
|
Delete a merged branch |
|
Force delete a branch, even if Git warns you |
5.1.3. Keeping master
up to date
Command Sequence |
Notes |
$ git checkout master $ git remote update $ git pull upstream master |
Make sure you are on the master branch
Update remote refs
Fetch and merge the upstream changes
|
5.1.4. Keeping master
up to date while retaining local changes
Command Sequence |
Notes |
$ git remote update $ git stash $ git checkout master $ git pull upstream master $ git checkout [PREVIOUS BRANCH] $ git stash pop |
See what has changed upstream
Set aside local changes
Checkout the master branch
Fetch and merge code from upstream
Go back to the branch you were working on
Re-apply your local changes
|
5.1.5. Changing branches
Command Sequence |
Notes |
$ git status # address changes (e.g. stash, commit, or revert) $ git checkout [BRANCH] |
See if you have any local changes
Deal with your local changes
Change branches
|
5.1.6. Making a commit
Command Sequence |
Notes |
# edit files...make changes $ git status $ git diff $ git add [PATH TO FILE TO ADD] $ git commit -m "Your message..." |
Do your coding work, whatever it may be…
See what you’ve changed
Evaluate what changed
Add changes to the staging area
Actually make the commit.
|
Note
Most of the time in order to make simple, clear, consise commits, you need granular control over which lines of each file shoud be comitted. This is possible using the command line interface to Git but is frequently easier using a graphical client such as Git Cola or Git Gui. Thre are many other graphical clients available as well.
5.1.7. Code Management
|
Fetch all new commits from all remotes |
|
Update the current branch from the remote repository |
|
Stage the changes made to filename for committing |
|
Discard changes made to filename |
|
Unstage changes made to filename but don’t discard them |
|
Commit all staged changes |
|
Push your local branch to the specified remote repository |
5.2. Docker
Depending on your setup, you may need to replace docker-compose
with
docker compose
in the following commands.
|
Start the container(s) |
|
Run a one-off command inside a container |
|
Run |
|
Run |
|
Exit the container |
|
Shut down the container(s) |
5.3. dvmdostem
These are a few of the most common script calls and commands related to
running dvmdostem
. More complete instructions can be found by using the
--help
option with each program.
|
Set up a working directory |
|
Disable all cells in the run mask |
|
Enable cell 0,0 in the run mask |
|
Disable all outputs |
|
Enable an output (generic) |
|
Enable GPP output by month and pft |
|
Run dvmdostem with error level logging and a specified config file |