SCM analysis of Emergency Department outcomes for SIPPRA, including: 1. Process for building the data 2. Analysis of the data 3. Production of reports and other deliverables
File structure
├── Y:\LHP\HelloFam\SIPPRA\HF_SIPPRA <- Main folder for local repo
├── ...\Data <- SC-DSS restricted data
├── ...\AdminData <- Environments for each user
├── ...\Output <- Processed data
├── ...\_temp <- To hold temp datafiles separate from output data
├── ...\Programs <- All code (R and Stata)
├── ...\Programs\Environments <- Environments for each user
├── ...\Programs\Data_build <- Building the data
├── ...\Programs\Plots <- Figures for reports
├── ...\Programs\Tables <- Results tables and tables for publication/reports
├── ...\Work_XX <- Individual sandboxes for each user to work out of. Each sandbox contains a version of the main repo
├── ...\Tables <- Contains final tables (analysis and final publication)
├── ...\Plots <- Contains final plots
├── ...\Reports <- **POTENTIAL** contains templates and output from LaTex-written reports
If you started with this file, it's OK, but I'd recommend starting here, to go over a brief overview of what Git is and why we are using it.
Then, read this file BEFORE setting anything up. Follow the instructions below to get started.
You need to do the following before even starting to set up your Git:
- Download and install Note++ (if you haven't already): this program is great for writing code and for comparing files when editing. HelpDesk can help you install this.
- Download install Git Bash: here is where we will mainly engage with Git to set things up, push changes, and pull updates. HelpDesk can help you install this.
- (Optional) Download GitHub: sometimes it might be easier to check things directly here. Not really needed.
- (If you want to) Download Visual Studio: great platform to work on most programming languages and Git.
The first step is to set up your identity using the following code on Git Bash:
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
Next, you need to create an SSH to authenticate users. Only users who have an SSH connected to the project can work on HF_SIPPRA.
Setting Up SSH on Git Bash
-
Open Git Bash and check for an existing typing - no worries if nothing comes up, just means that you don't have any keys set up yet.
$ ls -al ~/.ssh -
Generate a new SSH key
$ ssh-keygen -t ed25519 -C youremail@urban.orgYou'll be prompted to save the folder in a specific location or in the default. Default is fine, so just press the Enter key on your keyboard.
-
Start the SSH agent
$ eval "$(ssh-agent -s)" -
Then, copy your key
$ clip < ~/.ssh/id_ed25519.pub -
Then we switch to GitHub.com and create a new account (if you don't have one already)
GitHub Account
-
Go to GitHub and create an account. You may need to check with the GitHub folk (quickest on Slack) to have your Git connected to UI-Research. UI-Research is Urban's repository for all Urban work.
-
Once you've created your account, navigate to Settings (the circle in the top right, click on it and the drop down menu).
-
In the Settings page, on the left hand side, there should be an option with SSH and GPG keys (key icon). At the very top, there should be a green button that says "New SSH key". Click it.
-
Add a title to it, like HF_SIPPRA.
-
In the box named Key paste the key you copied from Bash and press the green button "Add SSH key". You should be set!
-
On the Git Bash Terminal, check if the connection
$ ssh -T git@github.comwhere you should see one of three GitHub public fingerprints
SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s (RSA SHA256) SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM (ECDSA SHA256) SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU (Ed25519 SHA256)
Now, we need to clone the main repository so that we can set up you individual sandbox. To clone the repository onto your workstation, you must:
-
Use the Git Bash Terminal to set your working directory
$ cd Y:/LHP/HelloFam/SIPPRA/HF_SIPPRA -
Clone the repo
$ git clone https://github.com/UI-Research/HF_SIPPRA/ -
Rename the folder you cloned
HF_SIPPRAtoWork_XX, replacing XX with your initials. The folder is renamed in your Windows Explorer (so directly on the Y drive HF_SIPPRA folder). -
Change your working directory to your sandbox
$ cd Y:/LHP/HelloFam/SIPPRA/HF_SIPPRA/Work_XX -
Check that your branch exists
$ git branchYour sandbox_xx should be in green, meaning you are working off your sandbox. Contact the Git manager if you see otherwise.