# Tutorial: Create Github Repos of NP lib

This is a tutorial of how to create a git repository for your lecture project: numerical programming library, EC driver, documentation etc.

## Preparation

1. **Create Github account**: [https://ykkim.gitbook.io/dlip/programming/github](https://ykkim.gitbook.io/dlip/programming/github)
2. **Install Github Desktop:** [https://ykkim.gitbook.io/dlip/programming/github/gitbook-desktop](https://ykkim.gitbook.io/dlip/programming/github/gitbook-desktop)

## Part 0. Lecture Assignment/Project Folder

### Create local directory for Project

We will create the main directory for NP (**or** EC) programs under

**C:\Users\yourID\source\repos**

You can search for 'repos' in window menu

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-cd3e4bba8da3eb578182540e5f421ad35f2b5a83%2Fimage.png?alt=media)

This is where your assignment projects should be located.

For Numerical Programming

* Name the directory as "**NumerialProg"** or \*\*\*\* "**NP**".

For Embedded Controller

* Name the directory as "**EC"**.

#### Example:

* **C:\Users\yourID\source\repos\NumerialProg**
* **C:\Users\yourID\source\repos\NumerialProg\Assignment**
* **C:\Users\yourID\source\repos\NumerialProg\Tutorial**

## Part 1. Github Desktop Setup

We will create the main directory for Github Desktop under **\~\source\repos\\**

#### \*\*\*\*

### **Create Directory for GithubDeskop**

Name the directory as 'GithubDesktop'. This is the root directory where your Github Repository will be located in your local drive.

* **C:\Users\yourID\source\repos\GithubDesktop**

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-97ad2539abde86d108fbc7698e052370914210c2%2Fimage.png?alt=media)

## Part 2. Clone Class' Github repository on local drive

### Clone repository 'NumericalProg-student'

After you login your github account, go to the NP class github site

{% embed url="https://github.com/ykkimhgu/NumericalProg-student" %}

Then, click **Code>Open with Github Desktop**

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-02d6062a42634ccf1de05c565837acb6442eb74b%2Fimage.png?alt=media)

Then, it will launch the Desktop Program.

**Clone in Local path :** C:\Users\yourID\source\repos\GithubDesktop\NumericalProg-student

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-e24624dd9a12507474e5ae8968dbad41a58be563%2Fimage.png?alt=media)

After cloning,view your repository in Explorer: `Ctrl` `Shift` `F`

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-88f1a01ed775bbab5d2e1aad28ae11c36fbf6ab0%2Fimage.png?alt=media)

Check all the files are located in the local drive.

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-5df25b856d97f8fdb424bae8169089745438cec9%2Fimage.png?alt=media)

## Part 3. Create your Github repository

### Create new repository : private

{% hint style="info" %}
The repository should be PRIVATE to limit your source code access
{% endhint %}

For Numerical Programming(2021-2\~)

* Name the repository as "**NumericalProg**".

For Embedded Controller

* Name the repository as "**EmbedController"**.

For Numerical Method(\~2021-1)

* Name the repository as "**tutorialNM**.

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-60b2fde84348189e1399c841870cadbbc75269c9%2Fimage.png?alt=media)

### Clone in Local drive

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-2c56e1306f0bedcf063fb4c66c440fe1cbf7f4a6%2Fimage.png?alt=media)

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-6ffa7a007fda8594e86f93725e12831149621e6d%2Fimage.png?alt=media)

When you open the local repository in Explorer, It will be a blank directory.

###

### Copy files in Local drive

Copy all folder and file from **'NumericalProg-student'** to your repository in Explorer.

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-e4d1ff611ac231f86574d0e9394f015edfb6c772%2Fimage.png?alt=media)

### Commit and Publish in Github Server

On the Github desktop, you will see all the changes in repository. We will push these changes to the github server .

**Write a comment "** added files" then Press **Commit to main**

Then, **Publish** **branch .**

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-b47b74a82c73d1695fadaa4c43e802743d71d305%2Fimage.png?alt=media)

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-f3e9d10b31dd3c4b5e1aee34a159f6571d02d609%2Fimage.png?alt=media)

Go to your repository website `Ctrl` `Shift` `G` and check all the files are updated.

![](https://3453146497-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgmrEstOHxu62gXxq1t%2Fuploads%2Fgit-blob-db4b0567fd0223063ad3951bd1ece236122fab19%2Fimage.png?alt=media)

## Next

Tutorial: Creating Library Documentation with Markdown(md)
