"<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."
]
},
{
...
...
@@ -80,7 +80,7 @@
"metadata": {},
"source": [
"<h4>Step 2</h4>\n",
"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.\n",
"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.\n",
"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",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"cd /Users/filepath/etc/usvi-transportation"
]
},
{
...
...
%% 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><ahref="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><ahref="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><ahref="https://www.atlassian.com/git/tutorials/install-git">Follow the guide located here</a> then read below.
<p>To use git with you will need to install Anaconda Prompt. To download Anaconda, you can <ahref="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.
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
gitconfig--globaluser.name"Firstname Lastname"
gitconfig--globaluser.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"