diff --git a/module4/ressources/resources.html b/module4/ressources/resources.html index 9d397a651e98aa7d6b3228d6ac674494e8db9816..6e510c4f089ac8734880d52a30254b4d79ff2a71 100644 --- a/module4/ressources/resources.html +++ b/module4/ressources/resources.html @@ -3,25 +3,114 @@
+When taking notes, it may be difficult to remember which version of +the code or of a file was used. This is what version control is useful +for. Here are a few useful commands that we typically insert at the +top of our notebooks in shell cells +
+ +git log -1 ++
+commit 741b0088af5b40588493c23c46d6bab5d0adeb33 +Author: Arnaud Legrand <arnaud.legrand@imag.fr> +Date: Tue Sep 4 12:45:43 2018 +0200 + + Fix a few typos and provide information on jupyter-git plugins. + ++ +
git status ++
+On branch master +Your branch is ahead of 'origin/master' by 4 commits. + (use "git push" to publish your local commits) + +Changes not staged for commit: + (use "git add <file>..." to update what will be committed) + (use "git checkout -- <file>..." to discard changes in working directory) + + modified: resources.org + +Untracked files: + (use "git add <file>..." to include in what will be committed) + + ../../module2/ressources/replicable_article/IEEEtran.bst + ../../module2/ressources/replicable_article/IEEEtran.cls + ../../module2/ressources/replicable_article/article.bbl + ../../module2/ressources/replicable_article/article.tex + ../../module2/ressources/replicable_article/data.csv + ../../module2/ressources/replicable_article/figure.pdf + ../../module2/ressources/replicable_article/logo.png + .#resources.org + +no changes added to commit (use "git add" and/or "git commit -a") ++ +
+Then, I often include commands at the end of my notebook indicating +how to commit the results (adding the new files, committing with a +clear message and pushing). E.g., +
+ +git add resources.org;
+git commit -m "Completing the section on getting Git information"
+git push
+
++[master 514fe2c1 ] Completing the section on getting Git information + 1 file changed, 61 insertions(+) +Counting objects: 25, done. +Delta compression using up to 4 threads. +Compressing objects: 100% (20/20), done. +Writing objects: 100% (25/25), 7.31 KiB | 499.00 KiB/s, done. +Total 25 (delta 11), reused 0 (delta 0) +To ssh://app-learninglab.inria.fr:9418/learning-lab/mooc-rr-ressources.git + 6359f8c..1f8a567 master -> master ++ +
+Obviously, in this case you need to save the notebook before running +this cell, hence the output of this final command (with the new git +hash) will not be stored in the cell. This is not really a problem and +is the price to pay for running git from within the notebook itself. +
+https://stackoverflow.com/questions/20180543/how-to-check-version-of-python-modules
@@ -86,9 +175,9 @@ Requires: patsy, pandas
Inspiring from StackOverflow, here is a simple function that lists
loaded package (that have a __version__
attribute, which is
@@ -147,9 +236,9 @@ zlib 1.0
The easiest way to go is as follows:
@@ -167,9 +256,9 @@ dynamic libraries that are wrapped by Python.
The best way seems to be to rely on the devtools
package.