# Can haxelib install an external lib from a specific commit/tag?

**URL:** <https://community.haxe.org/t/can-haxelib-install-an-external-lib-from-a-specific-commit-tag/2499>\
**Category:** Haxe\
**Tags:** haxelib\
**Created:** [June 2, 2020, 9:50am UTC](https://community.haxe.org/t/can-haxelib-install-an-external-lib-from-a-specific-commit-tag/2499 "2020-06-02T09:50:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Recursive](https://avatars.discourse-cdn.com/v2/letter/r/f05b48/32.png) [@Recursive](https://community.haxe.org/u/Recursive)\
**Post date:** [June 2, 2020, 9:50am UTC](https://community.haxe.org/t/can-haxelib-install-an-external-lib-from-a-specific-commit-tag/2499/1 "2020-06-02T09:50:55Z")

</div>

Documentation says “haxelib git” can address a branch in a remote repo. However, if I have reasons to worry that future changes in that branch may break my code, what should I do? A solution which comes to my mind immediately is to include external lib as a git submodule and do “haxelib dev”, but maybe there’a a different way?

---

<div class="post-metadata">

**Author:** ![RealyUniqueName](https://community.haxe.org/user_avatar/community.haxe.org/realyuniquename/32/10_2.png) [@RealyUniqueName](https://community.haxe.org/u/RealyUniqueName)\
**Post date:** [June 2, 2020, 9:58am UTC](https://community.haxe.org/t/can-haxelib-install-an-external-lib-from-a-specific-commit-tag/2499/2 "2020-06-02T09:58:58Z")

</div>

AFAIR you can specify a commit instead of a branch for `haxelib git`

---

<div class="post-metadata">

**Author:** ![mark.knol](https://community.haxe.org/user_avatar/community.haxe.org/mark.knol/32/50_2.png) [@mark.knol](https://community.haxe.org/u/mark.knol)\
**Post date:** [June 2, 2020, 10:59am UTC](https://community.haxe.org/t/can-haxelib-install-an-external-lib-from-a-specific-commit-tag/2499/3 "2020-06-02T10:59:36Z")

</div>

Yeah you can checkout a commit hash instead of branch. See this for exact syntax.

> **[Using Haxelib - Haxelib Documentation](https://lib.haxe.org/documentation/using-haxelib/#git)**
>
> Haxe is an open source toolkit based on a modern, high level, strictly typed programming language.

---

<div class="post-metadata">

**Author:** ![RblSb](https://avatars.discourse-cdn.com/v2/letter/r/edb3f5/32.png) [@RblSb](https://community.haxe.org/u/RblSb)\
**Post date:** [April 14, 2023, 8:45pm UTC](https://community.haxe.org/t/can-haxelib-install-an-external-lib-from-a-specific-commit-tag/2499/4 "2023-04-14T20:45:26Z")

</div>

There is no commit hash example in documentation, maybe it works like that

> <https://github.com/HaxeFoundation/haxelib/issues/238#issuecomment-365891161>
>
> It doesn't seem possible to have git dependencies currently : 
> 
> \`\`\` json
> "depend…encies": {
> "hxnodejs": "https://github.com/HaxeFoundation/hxnodejs.git"
> }
> \`\`\`
> 
> The above seems to fail. Or maybe there is another syntax ?
> If not, then I think it would be nice to support git dependencies, pretty much like \`npm\` does.
