GitHub is a version control system that is built on Git. It allows one to store code and make changes to an online repository. This allows one to easily change and update code as well as collaborate with others by sharing a common repository. We will be using GitHub Classroom to distribute all of the stencil code for assignments using a link on the course website, but let’s learn a little more about GitHub and Git.
Git is the basis of GitHub and is a version control system you can use right from the command line, you can learn more about it on their website!
Below are some common git commands to get you started!
git clone [URL-or-path-to-repo]
- Retrieve an entire repository from a hosted location via URL to your local machinegit status
- Display the state of the current repository. Use this to see your tracked files, untracked files and changes.git add [file]
- Add the given file to the repository. Use this when you create a new file and want to include it in a commit. Alternatively, include `[-a]`` to add all files from your local repogit commit -m [some message]
- Commit your code to finalize and save changes to your current branch and repo on your local machine.[-a]
to automatically add changed files that git is already tracking and [-m “[some message]”]
to include a message about the commit (otherwise you will be kicked to an editor in which to type out your message).git push
- Push whatever commits you have made locally to the repository you cloned from to save your changes to the online repo. (You might have to pull first to sync with the remote repository)git pull
- Pull any changes from the remote repository you cloned from.If you prefer GUIs we recommend using GitHub Desktop, this gives you a great visual way of interacting with GitHub. It allows you to better visualize your code changes when you commit and push, and helps prevent committing files that you don't want to be stored in your repo.
You can download Github Desktop for your platform here, and follow the setup guide here.
When you click the Github Classroom link for a programming assignment and accept the assignment, it will bring you to a repository for you to use for that assignment. If you click the green Code
button in the top right corner, you should see something like the following:
You can then either use Github Desktop to clone the repository, your use the first URL and type git clone [URL]
.
Note: You may need to create a GitHub Personal Access Token to clone using the CLI.
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 alt](https:// "title") | 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.
Syncing