# Get libcanard code with git submodule update is not newest code

**URL:** <https://forum.opencyphal.org/t/get-libcanard-code-with-git-submodule-update-is-not-newest-code/187>\
**Category:** Libcanard\
**Created:** [October 10, 2018, 8:07am UTC](https://forum.opencyphal.org/t/get-libcanard-code-with-git-submodule-update-is-not-newest-code/187 "2018-10-10T08:07:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cherish-Gww](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/cherish-gww/32/1129_2.png) [@Cherish-Gww](https://forum.opencyphal.org/u/Cherish-Gww)\
**Post date:** [October 10, 2018, 8:07am UTC](https://forum.opencyphal.org/t/get-libcanard-code-with-git-submodule-update-is-not-newest-code/187/1 "2018-10-10T08:07:19Z")

</div>

Hi Here is my issue:

1. I create a .gitmodule file in my project path.

[submodule “libcanard”]  
path = libcanard  
url = [https://github.com/UAVCAN/libcanard](https://github.com/UAVCAN/libcanard)

1. when I use command:  
$ git submodule update --init --recursive

I get the code is not newest, here is the newest patch:

acommit c3822b37d4dcd690d4d85fe5330b0880c9b9f57c  
Author: Pavel Kirienko [pavel.kirienko@gmail.com](mailto:pavel.kirienko@gmail.com)  
Date: Sun Aug 19 11:27:52 2018 +0300

```
STM32 driver README update

The driver is tested against STM32F446

```

and when I use command in libcanrd patch:  
$ git pull orign master  
Then I get newest code.

So I want to know is that use  
$ git submodule update --init --recursive  
could get newest code? or it is a release code?

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [October 10, 2018, 8:10am UTC](https://forum.opencyphal.org/t/get-libcanard-code-with-git-submodule-update-is-not-newest-code/187/2 "2018-10-10T08:10:35Z")

</div>

The proper way to add a git submodule is to run `git submodule add <url> [directory]`. Do not edit the submodule file manually. Refer to the git docs for more info.

---

<div class="post-metadata">

**Author:** ![Cherish-Gww](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/cherish-gww/32/1129_2.png) [@Cherish-Gww](https://forum.opencyphal.org/u/Cherish-Gww)\
**Post date:** [October 13, 2018, 8:22am UTC](https://forum.opencyphal.org/t/get-libcanard-code-with-git-submodule-update-is-not-newest-code/187/3 "2018-10-13T08:22:02Z")

</div>

Thank your pavel.kirienko  
I said something wrong, I did not touch .gitmodule.  
problem have been solved.  
I called execute\_process in my cmake to update codes from github.  
Thank you
