Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
git_intro/cheatsheet.md
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
63 lines (63 sloc)
1.69 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git | |
* Installation | |
```bash | |
Linux: sudo apt-get install git | |
Windows: https://git-scm.com/download/win | |
``` | |
* Creating ssh key | |
```bash | |
ssh-keygen -t rsa -b 4096 -C mymail@adress.com | |
``` | |
* Setting up git | |
```bash | |
git config --global user.name “name” | |
git config --user.email “mail” | |
``` | |
* Workflow | |
```bash | |
git clone git@github.com:<user>/<project>.git | |
git pull (gets new code from github) | |
git add <file> (add your work to next commit [stage]) | |
git commit -m “changelog” (add all staged files to repo) | |
git push (upload your changes to github) | |
``` | |
* Branching | |
```bash | |
git checkout -b <name-of-branch> (create new branch) | |
git checkout <name-of-branch> (get existing branch) | |
``` | |
* Adding a Remote (on real GitHub) | |
```bash | |
(Requires you already created a repo on github.com with name repo) | |
git remote add release git@github.com:<user>/<repo>.git | |
git push -u release master (copies master branch) | |
``` | |
# jupyter | |
* Install Python3 Kernel | |
```bash | |
python3 -m pip install ipykernel --user | |
python3 -m ipykernel install --user | |
``` | |
* Install R Kernel | |
```R | |
install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest')) | |
devtools::install_github('IRkernel/IRkernel') | |
IRkernel::installspec() | |
``` | |
* Install Jupyter Lab (new frontend for notebooks) | |
```bash | |
python3 -m pip install jupyterlab --user | |
``` | |
* Run Notebook Server Locally | |
```bash | |
jupyter notebook | |
jupyter lab | |
Run Notebook Server from outside/home | |
ssh -L 8889:localhost:8889 <user>@geniux.molgen.mpg.de | |
ssh -L 8889:localhost:8889 elcattivo (or other) | |
jupyter notebook --port 8889 | |
Useful shortcuts | |
<Shift> + <Enter> run Cell/Block | |
<Ctl> + <Shift> + <D> single document mode (in jupyter lab) | |
<Ctl> + <Tab> infos for the current variable | |
``` |