Important notes

Getting helps

Consult git-scm command reference,

man git
man git-add

The latter will give more specific command-line options available.

Git Bash for Windows

It is helpful to note that c:/ and u:/ can be used as well as /c and /u, respectively.

MarkDown code extraction

To extract bash code from GitHub markdown, the following is helpful,

sudo apt install npm
sudo npm install -g codedown
cat | \
codedown bash

This also works when the keyword is wrapped in braces, e.g., {r}.

Additional information on npm (Node Package Manager) is available from

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine, available from

MarkDown editor

One may prefer Typora, available from In particular, it supports mermaid, e.g., The following is an example generated from the link to SVG,

The following code sets up remarkable.

sudo apt-get update
sudo apt-get install gir1.2-webkit-3.0
sudo dpkg -i remarkable_1.87_all.deb
sudo apt-get install -f
git clone MathJax

The last step enables mathtype formatting in the html format (e.g., via pandoc) with

<script type="text/javascript" src="MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="MathJax/MathJax.js"></script>

MathJax and mermaid

On-the-fly examples for html are here,


Employ this add-on for a drop-down menu within your browser for GitHub repositories.

Pop-up windows

A window may pop up for password, which could cause problems with command-line interface but this can be disabled with


or unset GIT_ASKPASS which could be part of .bashrc. Alternatively, this could be achieved with disabling DISPLAY, i.e.,

git push

Additional tips

# recover directory R-packages that has been deleted

git checkout $(git rev-list -n 1 HEAD -- "R-packages")^ -- "R-packages"

# or zsh with the EXTENDED_GLOB option enabled for $file
git checkout $(git rev-list -n 1 HEAD -- "$file")~1 -- "$file"

# Recursive clone

git clone --recursive

# add

git add

# config

git config --global --unset-all core.editor
git config --unset-all core.editor
git config --global core.editor "pico -w"

# commit

git commit -m "README"

# diff

git diff

# mv

git mv -f

# pull

git pull

# push

git push

# rebase

git rebase

# reset

git reset --hard

# revert

git revert

# rm

git rm

# clean

git clean -d -f -x

As with many repositories here, a collection of the commands can be built into a batch file to save typing.


Login at and regenerate; make sure to make a copy afterwards.