# Switched our template over to 2.0 and getting git error trying to pull remote ref

**URL:** <https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371>\
**Category:** Bug Reports\
**Created:** [February 28, 2018, 9:01pm UTC](https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371 "2018-02-28T21:01:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sereeth](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/sereeth/32/11110_2.png) [@sereeth](https://discuss.circleci.com/u/sereeth)\
**Post date:** [February 28, 2018, 9:01pm UTC](https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371/1 "2018-02-28T21:01:32Z")

</div>

fatal: Couldn’t find remote ref ? Any ideas on what might be going on, had no issues on our 1.0 template.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [February 28, 2018, 9:31pm UTC](https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371/2 "2018-02-28T21:31:29Z")

</div>

In general, when seeking help, please supply all the information necessary to help you in your question, rather than waiting to be asked. We’d probably need to see your `config.yml` file at least (this can be supplied in a formatted block).

The error sounds like a branch problem, so readers may need information about what branch you’re expecting - does it have a `master`?

---

<div class="post-metadata">

**Author:** ![sereeth](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/sereeth/32/11110_2.png) [@sereeth](https://discuss.circleci.com/u/sereeth)\
**Post date:** [February 28, 2018, 9:36pm UTC](https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371/3 "2018-02-28T21:36:42Z")

</div>

Template is pretty straightforward, build was initiated from a pull request branch.

```
version: 2
jobs:
  build:
    docker:
      - image: circleci/java:8
        environment:
          - PG_HOST=localhost
          - PG_USER=ubuntu
      - image: postgres:9.6
        environment:
          - POSTGRES_USER=ubuntu
          - POSTGRES_DB=portal
    steps:
      - checkout

```

Full error:

```
Cloning into '.'...
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.

remote: Counting objects: 215384, done.        
remote: Compressing objects: 100% (73/73), done.        
remote: Total 215384 (delta 62), reused 33 (delta 33), pack-reused 215278        
Receiving objects: 100% (215384/215384), 102.16 MiB | 21.23 MiB/s, done.
Resolving deltas: 100% (169341/169341), done.
Checking connectivity... done.
Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.

fatal: Couldn't find remote ref pull/6229/head
Exited with code 128
```

---

<div class="post-metadata">

**Author:** ![sereeth](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/sereeth/32/11110_2.png) [@sereeth](https://discuss.circleci.com/u/sereeth)\
**Post date:** [February 28, 2018, 9:49pm UTC](https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371/4 "2018-02-28T21:49:51Z")

</div>

I wonder if it’s getting confused because the developer named their branch with a slash in it ‘pull/6229’

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [February 28, 2018, 10:03pm UTC](https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371/5 "2018-02-28T22:03:24Z")

</div>

That looks like a Git repository problem to me. I don’t think the slash is a problem - they are often used in feature-branch names.

Have you tried cloning the repo locally? Are you using a Git hosting provider (BitBucket, GitHub, etc) or are you self-hosting? I wonder if a `git fsck` is in order on the remote repo (do `git help fsck` and back up your master repo first).

Also, [various solutions here](https://duckduckgo.com/?q=git+Couldn%27t+find+remote+ref+pull+head&t=lm). Not a CI issue, in my opinion.

---

<div class="post-metadata">

**Author:** ![sereeth](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/sereeth/32/11110_2.png) [@sereeth](https://discuss.circleci.com/u/sereeth)\
**Post date:** [February 28, 2018, 10:31pm UTC](https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371/6 "2018-02-28T22:31:09Z")

</div>

We’re using GitHub BTW. Going to do some digging on this locally and see if I can replicate it

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [February 28, 2018, 10:33pm UTC](https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371/7 "2018-02-28T22:33:21Z")

</div>

Gotcha. Someone else is having trouble with GitHub/Circle - see the related link under your OP. Maybe I will have to eat my hat, and it is a Circle issue! 😼

---

<div class="post-metadata">

**Author:** ![sereeth](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/sereeth/32/11110_2.png) [@sereeth](https://discuss.circleci.com/u/sereeth)\
**Post date:** [March 1, 2018, 4:53pm UTC](https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371/9 "2018-03-01T16:53:18Z")

</div>

Sooo wierd… So branches created with pull/ in them fail, while branches with whatever/ are ok. I’m sure this is something with the github repo, trying to figure out what. Wierd thing is jenkins builds the same repo same branch just fine

For the pull/ branches circle bash script does (note head appended to end in pull/)

git fetch --force origin “pull/5234\_widget/head:remotes/origin/pull/5234\_widget”

and for the others:

git fetch --force origin “jason/did\_something:remotes/origin/jason/did\_something”

---

<div class="post-metadata">

**Author:** ![danny-andrews-snap](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/danny-andrews-snap/32/19245_2.png) [@danny-andrews-snap](https://discuss.circleci.com/u/danny-andrews-snap)\
**Post date:** [May 3, 2018, 3:59pm UTC](https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371/10 "2018-05-03T15:59:36Z")

</div>

I ran into a similar issue. Weird thing is, branch names with a single slash work fine, but not multiple slashes!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [August 1, 2018, 3:59pm UTC](https://discuss.circleci.com/t/switched-our-template-over-to-2-0-and-getting-git-error-trying-to-pull-remote-ref/20371/11 "2018-08-01T15:59:41Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
