git apply patch filename, where filename is a .patch
file. E.g.:
git apply patch biomasspy.patch
git archive --format tar.gz --output filename --prefix prefix branch
E.g.:
$ git archive --format tar.gz --output ~/sara-config.tar.gz --prefix sara-config/ master
Delete branch locally:
git branch -d localBranchName
Delete branch remotely:
git push origin --delete remoteBranchName
git log tagname
or:
git rev-list tagname
To list files being tracked under branch branch:
git ls-tree -r branch --name-only
E.g.:
git ls-tree -r master --name-only
Workflow:
- Update notebook on branch. Clear outputs and save.
- Commit and push.
- Change to master.
- Rebase.
- Execute notebook.
- Commit with
--amend
option. - Force push.
Rebasing after modifying a notebook:
git rebase -X ours branch
E.g.:
$ git rebase -X ours development
Commit with --amend
option:
git commit -a --amend -m comment
E.g.:
$ git commit -a --amend -m 'Notebook re-executed'
Force push:
git push --force
$ git reset --hard