git simple tutorial
===

Add ssh key to GitHub
---
> Now, password authentication is disabled by default. Therefore we use ssh key to authorize.

```
$ ssh-keygen
$ cat .ssh/id_rsa.pub
```

Clone the repository to computer
---

```
$ git clone git@github.com:datastru/hw1-example-estherYJ.git
```
Do initial settings
---
```
$ git config --global user.email "you@example.com"
$ git config --global user.name "Your Name"
```
Push to git after compiling and test
---
```
$ git add src/hw1_p1-1.c
$ git commit
$ git push
```
* If there is an error during push. Do `$git pull --rebase` then push again.

* The result would be shown on Github Actions after pushing.


### Additional Materials
[Git - Book](https://git-scm.com/book/zh-tw/v2)
[An Introduction to Git: The Basics Every Beginning Developer Should Know](https://docs.ionos.space/blog/git-intro/#the-git-workflow)
local build & test
---
project structure will be like

```
$ cd hw1-example-XXX
// gcc -O3 -std=c11 -Wall -c -o src/hw1_p1-1.o src/hw1_p1-1.c
// gcc -O3 -std=c11 -Wall -o output/hw1_p1-1.output src/hw1_p1-1.o
// ...
$ make
// input test from stdin and output to a file or stdout
$ output/hw1_p1-1.output < test/hw1_p1-1/input01.txt > result.txt
// compare with output file
$ diff -w result.txt test/hw1_p1-1/output01.txt
// remove result
$ rm result.txt
```