# Git symlinks support?

**URL:** <https://travis-ci.community/t/git-symlinks-support/274>\
**Category:** Windows\
**Created:** [October 12, 2018, 7:35am UTC](https://travis-ci.community/t/git-symlinks-support/274 "2018-10-12T07:35:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![XhmikosR](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/xhmikosr/32/137_2.png) [@XhmikosR](https://travis-ci.community/u/XhmikosR)\
**Post date:** [October 12, 2018, 7:35am UTC](https://travis-ci.community/t/git-symlinks-support/274/1 "2018-10-12T07:35:46Z")

</div>

Hello!

I saw the news and decided to give this a go. It seems to work good as a first step.

One thing I noticed is that git symlinks aren’t enabled. Is there any way to configure the git config options before the clone? Like `git config --global core.symlinks true`.

---

<div class="post-metadata">

**Author:** ![djhoese](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/djhoese/32/772_2.png) [@djhoese](https://travis-ci.community/u/djhoese)\
**Post date:** [May 8, 2020, 5:55pm UTC](https://travis-ci.community/t/git-symlinks-support/274/2 "2020-05-08T17:55:32Z")

</div>

I realize this is old, but this would be great if this could be supported. I have a project that has a softlink and it took me forever to figure this out. My local Windows virtual machine didn’t have this issue, only travis Windows. I had code that was reading the file and was really confused why it was just a text file with the path to the source file.

If this can’t be set globally for all travis projects, is there a way we can customize the git command from the travis yaml file?

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [May 8, 2020, 7:18pm UTC](https://travis-ci.community/t/git-symlinks-support/274/3 "2020-05-08T19:18:54Z")

</div>

Sorry about the long silence.

This seems a reasonable option to have.

> <https://github.com/travis-ci/travis-build/pull/1906>

  

> <https://github.com/travis-ci/travis-yml/pull/175>

  

> <https://github.com/travis-ci/docs-travis-ci-com/pull/2777>

---

<div class="post-metadata">

**Author:** ![stronk7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/stronk7/32/3068_2.png) [@stronk7](https://travis-ci.community/u/stronk7)\
**Post date:** [June 7, 2020, 6:00pm UTC](https://travis-ci.community/t/git-symlinks-support/274/4 "2020-06-07T18:00:25Z")

</div>

Pardon for my ignorance, have been trying to find the answer to my question elsewhere but have failed to… when does this become available upstream? I have been trying to incorporate this to our experimental windows travis runs, because we need to add some symlinks to get behat working… and it seems that the option is still completely ignored.

Thanks, ciao 🙂

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [June 8, 2020, 2:07pm UTC](https://travis-ci.community/t/git-symlinks-support/274/5 "2020-06-08T14:07:49Z")

</div>

Please point to a build log URL that it’s not getting the results you want. Thanks.

---

<div class="post-metadata">

**Author:** ![stronk7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/stronk7/32/3068_2.png) [@stronk7](https://travis-ci.community/u/stronk7)\
**Post date:** [June 8, 2020, 2:28pm UTC](https://travis-ci.community/t/git-symlinks-support/274/6 "2020-06-08T14:28:01Z")

</div>

Hey, basically the last 4-5 runs of the “travis\_windows\_exp” branch @ [https://travis-ci.org/github/stronk7/moodle/branches](https://travis-ci.org/github/stronk7/moodle/branches)

I’ve tried there changing the order of the autocrlf and symlinks settings, adding and remove the hyphens (because I’m never sure about them)… and in all them I can see in the logs that the git config is issued for the autocrlf one, but nothing for the symlinks one.

Ciao 🙂

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [June 8, 2020, 2:30pm UTC](https://travis-ci.community/t/git-symlinks-support/274/7 "2020-06-08T14:30:42Z")

</div>

> <https://github.com/stronk7/moodle/blob/3b03869c9d9550e05c3acf7314a91a9c4645e0b7/.travis.yml#L13-L15>

You will notice that `autocrlf` isn’t working, either. Because your `git` value is an array and not a hash.

> **[Travis CI Documentation](https://docs.travis-ci.com/user/customizing-the-build/#setting-symlinks-option)**
>
> Customizing the Build

What you need is:

```auto
git:
  autocrlf: true
  symlinks: true

```

---

<div class="post-metadata">

**Author:** ![stronk7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/stronk7/32/3068_2.png) [@stronk7](https://travis-ci.community/u/stronk7)\
**Post date:** [June 8, 2020, 2:52pm UTC](https://travis-ci.community/t/git-symlinks-support/274/8 "2020-06-08T14:52:54Z")

</div>

> [@stronk7](#):
>
> [Travis CI - Test and Deploy with Confidence](https://travis-ci.org/github/stronk7/moodle/branches)

As commented above, I just started trying combinations to verify everything. For example @ [Experimenting with behat... · stronk7/moodle@b33b8d8 · GitHub](https://github.com/stronk7/moodle/commit/b33b8d83d9f2a814340f03e903d3163df3b9567d) I tried that way.

Ok, going to verify with both set to boolean, just in case the autocrlf is “killing” the symlinks one. In fact I think I also tried with singular… is it really singular? Anyway, trying…

---

<div class="post-metadata">

**Author:** ![stronk7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/stronk7/32/3068_2.png) [@stronk7](https://travis-ci.community/u/stronk7)\
**Post date:** [June 8, 2020, 2:59pm UTC](https://travis-ci.community/t/git-symlinks-support/274/9 "2020-06-08T14:59:01Z")

</div>

Uhm, I’ve tried here with the singular and no luck. Also, I think that “input” is correct one, from the user docs. That’s exactly what I want, keeping files as they are @ origin.

[https://travis-ci.org/github/stronk7/moodle/jobs/696078665](https://travis-ci.org/github/stronk7/moodle/jobs/696078665)

Ciao 🙂

Edited: And this back to plural, same: [https://travis-ci.org/github/stronk7/moodle/jobs/696080772](https://travis-ci.org/github/stronk7/moodle/jobs/696080772)

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [June 8, 2020, 3:04pm UTC](https://travis-ci.community/t/git-symlinks-support/274/10 "2020-06-08T15:04:16Z")

</div>

Ooops. I just realized that you are setting `symlink: true`, not `symlinks`. (I’ve updated my response above.)

---

<div class="post-metadata">

**Author:** ![stronk7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/stronk7/32/3068_2.png) [@stronk7](https://travis-ci.community/u/stronk7)\
**Post date:** [June 8, 2020, 3:05pm UTC](https://travis-ci.community/t/git-symlinks-support/274/11 "2020-06-08T15:05:30Z")

</div>

Heh, I tried both singular and plural! Also updated my reply 🙂

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [June 8, 2020, 3:07pm UTC](https://travis-ci.community/t/git-symlinks-support/274/12 "2020-06-08T15:07:12Z")

</div>

If you dump `git config -l`, you should see `core.symlinks=true`. [https://travis-ci.org/github/BanzaiMan/travis\_production\_test/jobs/696053149#L225](https://travis-ci.org/github/BanzaiMan/travis_production_test/jobs/696053149#L225)

If your build is failing, I must think that there is something else at play.

---

<div class="post-metadata">

**Author:** ![stronk7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/stronk7/32/3068_2.png) [@stronk7](https://travis-ci.community/u/stronk7)\
**Post date:** [June 8, 2020, 3:08pm UTC](https://travis-ci.community/t/git-symlinks-support/274/13 "2020-06-08T15:08:54Z")

</div>

Ok, will try dumping… I just was expecting to see in the logs the undelying git command being executed, much like the autocrlf one is shown. Seeing nothing is what made me think if the feature was rolled everywhere or not.

Thanks! Will continue trying…

---

<div class="post-metadata">

**Author:** ![stronk7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/stronk7/32/3068_2.png) [@stronk7](https://travis-ci.community/u/stronk7)\
**Post date:** [June 8, 2020, 3:14pm UTC](https://travis-ci.community/t/git-symlinks-support/274/14 "2020-06-08T15:14:40Z")

</div>

Just confirming… it’s not being set, `git config -l` shows false. Wow… in fact… it shows it twice!

Link: [https://travis-ci.org/github/stronk7/moodle/jobs/696085235](https://travis-ci.org/github/stronk7/moodle/jobs/696085235)

---

<div class="post-metadata">

**Author:** ![stronk7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/stronk7/32/3068_2.png) [@stronk7](https://travis-ci.community/u/stronk7)\
**Post date:** [June 8, 2020, 3:16pm UTC](https://travis-ci.community/t/git-symlinks-support/274/15 "2020-06-08T15:16:48Z")

</div>

Note i was just hopping that was enough to allow soft-links (that I need in those jobs to be able to test behat under windows) to work ok. In fact the jobs are failing because of that (the `ln -s` ends failing).

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [June 8, 2020, 4:01pm UTC](https://travis-ci.community/t/git-symlinks-support/274/16 "2020-06-08T16:01:57Z")

</div>

[https://travis-ci.org/github/stronk7/moodle/jobs/696085235#L51](https://travis-ci.org/github/stronk7/moodle/jobs/696085235#L51)

This is curious. I honestly don’t know what’s happening here.

---

<div class="post-metadata">

**Author:** ![stronk7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/stronk7/32/3068_2.png) [@stronk7](https://travis-ci.community/u/stronk7)\
**Post date:** [June 8, 2020, 5:28pm UTC](https://travis-ci.community/t/git-symlinks-support/274/17 "2020-06-08T17:28:46Z")

</div>

aha, repo, user vs global levels (pity it just doesn’t report the “active” conf):

[https://travis-ci.org/github/stronk7/moodle/jobs/696133855#L38](https://travis-ci.org/github/stronk7/moodle/jobs/696133855#L38)

So it seems that it’s being applied ok (both autocrlf and symlinks) and more local config wins, so far. So all right.

Still:

1. The `git config symlinks = true` execution is not shown in logs (that’s confusing).
2. Soft links continue not working here (a “cp” is attempted and it fails).

Will try some alternative somehow… thanks for the support!

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [June 8, 2020, 6:00pm UTC](https://travis-ci.community/t/git-symlinks-support/274/18 "2020-06-08T18:00:26Z")

</div>

Hmmm. So, on Windows,

```
file:C:/Program Files/Git/etc/gitconfig	core.symlinks=false

```

wins? 🤔

---

<div class="post-metadata">

**Author:** ![stronk7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/stronk7/32/3068_2.png) [@stronk7](https://travis-ci.community/u/stronk7)\
**Post date:** [June 8, 2020, 9:31pm UTC](https://travis-ci.community/t/git-symlinks-support/274/19 "2020-06-08T21:31:01Z")

</div>

I did read somewhere (sorry, haven’t the resource at hand) that the most-close (near, local) configuration wins. Aka: repo == wins over ==\> user == wins over ==\> global.

So, if that’s correct, then your approach is ok. Will try to find the reference…

---

<div class="post-metadata">

**Author:** ![stronk7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/stronk7/32/3068_2.png) [@stronk7](https://travis-ci.community/u/stronk7)\
**Post date:** [June 8, 2020, 9:35pm UTC](https://travis-ci.community/t/git-symlinks-support/274/20 "2020-06-08T21:35:42Z")

</div>

Here it is, if I’ve understood it ok, the “latest” (or more local) value wins. It also can be checked using `git config --get xxxx`, it seems.

> <https://stackoverflow.com/questions/52566321/git-config-list-only-the-effective-values/52570187#52570187>

Given that, your approach seems correct (setting it to travis user “wins” over system/global default).
