# Jekyll not pushing to gh-pages branch

**URL:** <https://travis-ci.community/t/jekyll-not-pushing-to-gh-pages-branch/12472>\
**Category:** Deployment\
**Tags:** bug\
**Created:** [December 10, 2021, 9:02pm UTC](https://travis-ci.community/t/jekyll-not-pushing-to-gh-pages-branch/12472 "2021-12-10T21:02:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SolarUltima](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/solarultima/32/4019_2.png) [@SolarUltima](https://travis-ci.community/u/SolarUltima)\
**Post date:** [December 10, 2021, 9:02pm UTC](https://travis-ci.community/t/jekyll-not-pushing-to-gh-pages-branch/12472/1 "2021-12-10T21:02:38Z")

</div>

final problem for the weekend is when I try and push I get

`error: src refspec gh-pages does not match any.`

im either going to push an additional server or rsync in re comments.

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [December 10, 2021, 9:05pm UTC](https://travis-ci.community/t/jekyll-not-pushing-to-gh-pages-branch/12472/2 "2021-12-10T21:05:41Z")

</div>

Travis checks out a shallow clone, so your local copy on the build VM does not know about the `gh-pages` branch, which is why you’re getting an error throw. Try fetching the branch with

```auto
git fetch --unshallow

```

Right before running `git push`. Then, to get access to all the branches on your origin:

```auto
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin

```

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [December 11, 2021, 9:40am UTC](https://travis-ci.community/t/jekyll-not-pushing-to-gh-pages-branch/12472/3 "2021-12-11T09:40:31Z")

</div>

> [@Montana](#):
>
> Travis checks out a shallow clone, so your local copy on the build VM does not know about the `gh-pages` branch, which is why you’re getting an error throw. Try fetching the branch with

Or just [specify](https://docs.travis-ci.com/user/customizing-the-build/#git-clone-depth)

```yaml
git:
  depth: false

```

to do a full clone.

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [December 14, 2021, 12:32am UTC](https://travis-ci.community/t/jekyll-not-pushing-to-gh-pages-branch/12472/4 "2021-12-14T00:32:26Z")

</div>

@native-api,

Ah, yes very true, and great catch!
