or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Step by step guide to working with the course repository
Wojciech Hardy
The course repository
Click here to view the course repository on GitHub
This is the course repository. It contains the base course materials and will be updated before some of the classes.
The idea is:
Step 1. FORKING
First you need to fork the course repository. Forking is a GitHub thing (not a Git thing!). It creates a copy of a repository on GitHub.
Importantly: one can access a list of the forked repositories. So when you work with your copies, I'll be able to browse through your copied repositories and check your commits.
Click the "Fork" button to proceed. (It's grayed out in the picture below because I can't fork my own repository).
Note: you cannot fork a repository more than once.
Step 2. CLONE YOUR COPY TO YOUR COMPUTER
2nd thing you need is to clone your repository. This will allow you to implement changes. IMPORTANT: you need to clone your copy of the course repository, not the original one!
Click the green "Code" button in the repository page (see below) and copy the HTTPS URL. Not sure if you're copying the right URL? By default it should include your username and look like this:
https://github.com/USERNAME/RRcourse2024.git
Go down to see what options you have now.
1. Use Git Bash (or other terminal) to do the cloning
Pick a suitable location and run:
git clone <copied_url>
It should create a RRcourse2024 folder with the repository inside. Warning: avoid creating repositories within repositories! Git doesn't like it!
Alternatively, you can use
git clone <copied_url> newName
to pick a new name for your local cloned repository.
2. Use GitHub Desktop to do the cloning
First, download and install GitHub Desktop.
Second, launch and log in using your GitHub account name and password.
Third, File -> Clone repository…
Choose your copy of the course repo, select a path at your desktop.
Done.
3. Use RStudio to do the cloning
First, download and install R (unless you already have it).
Second, download and install RStudio (unless you already have it).
Third, launch RStudio, then File -> New Project… -> Version Control -> Git
Fourth, paste the repository URL, pick a location for your repository/project. Create.
Status update
Great! you can now work in your local repository and push your commits back to YOUR copy of the course repository, that you have on GitHub.
If it's the first time you did this, you might be asked for authentication when pushing. Remember, it might not really ask for your GitHub password - it might want your Personal Access Token (this seems to depend on git version).
But what if we want to grab something from the original course repository (owned by WHardyUW on GitHub)?
Step 3. ESTABLISHING A LINK WITH THE ORIGINAL COURSE REPOSITORY
Right now, your local repository has a direct connection to your copy of the course repo. Not the original course repo.
If you want to grab updates from the original course repo (let's call it WHardyUW/RRcourse2024), you need to tell Git where to look for this additional 'remote' repository. You do it like so:
git remote add <some-name> https://github.com/WHardyUW/RRcourse2024.git
Note: <some-name> is just a name that you provide to your new link (like 'originalRepo' or 'WHardyRepo', etc.) So you can refer to the whole link without having to repeat it. Note that we're providing the link to the original repository, owned by WHardyUW. You already have a link to your own. This is a new one.
Great! now let's update our work
Let's start by checking for new information at WHardyUW/RRcourse2024:
git fetch <some-name>
where
some-name
is the name you chose before.Execute a merge:
git merge <some-name>/main
Note that
some-name
isn't a repository name. It's the name of the link.