Skip to content

Latest commit

 

History

History
141 lines (81 loc) · 3.35 KB

README.rst

File metadata and controls

141 lines (81 loc) · 3.35 KB

MadLab

Environment Setup

1. First get a github account

2. Setup git on HPC

3. Setup your ssh key! Follow steps 1 & 2 in 'github:help'

>>> cat ~/.ssh/id_dsa.pub

or

>>> cat ~/.ssh/id_rsa.pub

copy the key to your github account settings --> SSH Keys --> add SSH key

4. Fork the madlab_env repository. Then in a terminal:

>>> cd place/to/keep/repository

>>> git clone git@github.com/your_user_name/madlab_env.git

>>> cd madlab_env

>>> git remote add upstream https://github.com/mattfeld/madlab_env.git

5. Set up symlinks to the repository in your home folder

>>> cd /place/of/repository

You will need to do the following: >>> mkdir ~/madlab_git_repo >>> cd ~/madlab_git_repo

>>> python madlab_env_setup.py

6. Make sure you have a symlinked .bash_profile and .bashrc

>>> cd

>>> ls -la

7. Modify your ~/.ssh/config file

Test if SSH over the HTTPS port is possible, run this SSH command:

>>> ssh -T -p 443 git@ssh.github.com

You should see:

Hi username! You've successfully authenticated, but GitHub does not provide shell access.

Enabling SSH connections over HTTPS

>>> vi ~/.ssh/config

Add the following lines:

Host github.com

Hostname ssh.github.com

Port 443

8. Modify your ~/.git/config file

Change your [remote "origin"] url to the following:

url = ssh://git@github.com/YOURUSERNAME/madlab_env.git

Examples

Set your project environment to the CMIND project:

>>> cmind_env

You should see your prompt say "CMIND"

Create a pointer to the madlab_env repostiroy for the latest project environments:

>>> cd /place/of/repository

>>> git fetch upstream

>>> git merge upstream/master

To add an enviornment to the madlab_env repostiroy, make a separate environment shell script in the .env (called .my_project_environment in the example) in the madlab_env repository folder. Then edit the .projects file to add a function:

function my_project_env()

{

source ~/.env/.my_project_environment

}

Commit and push the file up to your repository

>>> cd /place/of/madlab_env/repo

>>> git add .env/.my_project_environment

>>> git add .projects

>>> git commit -m "added my project's environment"

>>> git push origin master

Test and send a pull request to mattfeld/madlab_env for someone else to review and merge your changes.

GIT Tutorials

Here are some great GIT tutorials:

First tutorial

Second tutorial