Skip to content
Snippets Groups Projects
Commit 42bc38b7 authored by Wigal, Jacob (CIV)'s avatar Wigal, Jacob (CIV) :sparkles:
Browse files

clarified cloning repository instructions

parent 2ec50235
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
### About
This notebook is for the following functions:
- create local repository with files copied from a remote repository
- set a username and email to be associated with your future file edits
%% Cell type:markdown id: tags:
<h2> Before we begin </h2>
You will need to have "git" installed.
<h4>Matlab users:</h4> <a href="https://www.mathworks.com/help/matlab/matlab_prog/set-up-git-source-control.html">Follow the guide located here</a> then skip ahead to "Get Started".
<br><h4>RStudio users:</h4> <a href="https://jennybc.github.io/2014-05-12-ubc/ubc-r/session03_git.html">Follow the guide located here</a> then skip ahead to "Get Started".
<h4>Python users and everyone else:</h4> <a href="https://www.atlassian.com/git/tutorials/install-git">Follow the guide located here</a> then read below.
%% Cell type:markdown id: tags:
<section>
<style type="text/css">p { margin:0}
</style>
<div style="float: left; width: 50%; line-height: 120%;">
Mac Users:
<p>You may enter git commands in the "Terminal" application already on your computer.</p>
</div>
<div style="float: right; width: 50%; line-height: 120%;">
Windows/PC Users:
<p>To use git with you will need to install Anaconda Prompt. To download Anaconda, you can <a href="https://docs.anaconda.com/anaconda/install/windows">follow the guide located here.</a></p>
</div>
</section>
%% Cell type:markdown id: tags:
# Get Started
Run the following commands in a command-line interface (e.g. Anaconda Prompt, Terminal) to download a remote repository and create a local repository to use in conjunction.
%% Cell type:markdown id: tags:
<h4>Step 1</h4> Choose a location for your local repository. Replace /Users/filepath/etc with your desired filepath for your local repository in the cell below.
<h4>Step 1</h4> Choose a location for your local repository. Replace /Users/filepath/etc with your desired filepath for your local repository in the cell below. For example, the filepath of your Desktop could be a good choice.
%% Cell type:code id: tags:
``` python
cd /Users/filepath/etc
```
%% Cell type:markdown id: tags:
<h4>Step 2</h4>
Clone the remote repository to the new local repository. (syntax: git clone https//repositoryurlcom/repo.git) The repository URL can be found by going to our GitLab repository, selecting clone, and copying what shows up under https.
Clone the remote repository to the new local repository. (syntax: git clone https//repositoryurlcom/repo.git) The repository URL can be found by going to a GitLab repository, selecting clone, and copying what shows up under https. In the below example we use the url of the USVI Transportation repository.
![Clone Repo GitLab](https://docs.gitlab.com/ee/user/admin_area/settings/img/clone_panel_v12_4.png "Clone Repo GitLab")
%% Cell type:code id: tags:
``` python
git clone https://gitlab.nps.edu/CID/USVI/example.git
git clone https://gitlab.nps.edu/CID/USVI/usvi-transportation.git
```
%% Cell type:markdown id: tags:
You can now cd to your newly created git repository on your desktop. Note that in the future you will always need to cd to your git repository before using git commands.
%% Cell type:code id: tags:
``` python
cd /Users/filepath/etc/usvi-transportation
```
%% Cell type:markdown id: tags:
<h4>Step 3</h4>
Set a username and email to be associated with your future file edits. (Replace name and email within quotes. Note: You are not creating a log-in. You are only telling git your name and email so it can tell others who has made edits once you have started working.)
%% Cell type:code id: tags:
``` python
git config --global user.name "Firstname Lastname"
git config --global user.email "email@example.com"
```
%% Cell type:markdown id: tags:
# Check Status
If the above was done correctly, you should see something similar to the following output: "On branch master,
Your branch is up-to-date, nothing to commit, working tree clean"
%% Cell type:code id: tags:
``` python
git status
```
%% Output
On branch master
nothing to commit, working tree clean
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment