> For the complete documentation index, see [llms.txt](https://ykkim.gitbook.io/ec/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ykkim.gitbook.io/ec/numerical-programming/ta-tutorial/tutorial-markdown-github.md).

# Tutorial: Version Control in Github

## Version Control

In this tutorial, we will learn how to use Github for version control of my library/SW for our numerical method functions.

For each assignment, you probably have created ‘myNM.h, myNM.cpp’ files in every project folder.

If there are multiple source files of the same file name, you may have trouble in controlling the version of your library.

> Create and modify myNM.h, myNM.cpp in ‘\include’ folder only

One suggestion is to create and modify your header in a directory and include those files/directory for each project, without copying the header files in the project folder.

After modifying your library source in every assignment, you may have a problem updating to the latest version.

For the version control, you should use git or github. For this tutorial, we will use Github Desktop.

## Exercise

### TA Session video

{% embed url="<https://www.youtube.com/watch?v=yFgIvPB_Q-c>" %}

1. Create a **private** repository for numerical method
   * Example: NumericalProg
2. Create folders within the repository as instructed in the

* [Tutorial: Create Github Repos of NP lib](/ec/numerical-programming/ta-tutorial/tutorial-markdown.md#preparation)

3\. Maintain your library source files`myNM.h, myNM.cpp` and `myMatrix.h, myMatrix.cpp` in the ‘\include’ folder only

{% hint style="info" %}
There should be only 1 copy of your header/lib files in local drive. Include this folder path to include these files in other program projects.
{% endhint %}

4\. Copy your final assignment main() source file in the folder `\sources`

* Also, you can copy necessary other files such as `data txt`

5\. Under the `\tutorial` folder, copy and push **tutorial, exercise** files of this lecture.

### When creating a new project for assignments

1.DO NOT copy the NM header files in each project folder.

2\. Configure V.Studio project configuration to include the path for your header files.

* located in that \`\include folder of the Git repository (local drive)
* For this example, ' ../GithubDesktop/NumericalProg/include'

3\. or you can directly include the header files in main().


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ykkim.gitbook.io/ec/numerical-programming/ta-tutorial/tutorial-markdown-github.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
