Project Management#

This chapter describes how to organize projects and ensure results are reproducible.

Shell Tips & Tricks#

Redirect all output to a file:

./script.sh 2>&1 > output.log

See this StackOverflow post.

Display output on screen and save to a file:

./script.sh 2>&1 | tee output.log

Git#

Tags#

To tag a workshop reader run (for example):

git tag -a 2022-spring -m "The reader used for Spring 2022."

The -a flag makes an annotated tag which includes a name, email, date, and message. The -m flag sets the message, as with git commit. You can optionally specify a commit number as the final argument to tag a past commit.

To push a tag, run:

git push origin 2022-spring

You can use the --tags flag instead to push all tags.

You can use git tag with -d to remove a tag or -f to force update a tag.

Purging Files#

GitHub has a helpful tutorial about purging files.

The simplest way to purge files is to use the BFG Repo Cleaner, which is available through conda-forge. To purge a file or directory, first remove it with git rm and git commit. Then run bfg with either the --delete-files flag or the --delete-folders flag. Both use glob syntax and search the entire repository (so the argument is a pattern, not a path).

Committing on Behalf of Others#

To make a commit on behalf of someone else, run:

git commit --author "NAME <EMAIL@ucdavis.edu>"