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 [email protected]/your_user_name/madlab_env.git
>>> cd madlab_env
>>> git remote add upstream https://github.com/mattfeld/madlab_env.git
>>> cd /place/of/repository
You will need to do the following: >>> mkdir ~/madlab_git_repo >>> cd ~/madlab_git_repo
>>> python madlab_env_setup.py
>>> cd
>>> ls -la
Test if SSH over the HTTPS port is possible, run this SSH command:
>>> ssh -T -p 443 [email protected]
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
Change your [remote "origin"] url to the following:
url = ssh://[email protected]/YOURUSERNAME/madlab_env.git
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.
Here are some great GIT tutorials: