Search code examples
gitgithubversion-controlrepo

How do I fix refs heads errors?


git fetch github +refs/heads/n:refs/remotes/github/n fatal: Couldn't find remote ref refs/heads/n : git fetch github +refs/heads/n-caf:refs/remotes/github/n-caf fatal: Not a git repository: '/home/movingshadowninja/DU/.repo/projects/kernel/oneplus/msm8994.git'

: export GIT_DIR=/home/movingshadowninja/DU/.repo/projects/device/oppo/common.git

I keep getting this errors how do I go about fixing it?


Solution

  • Please confirm these things:

    1. Check the remote repo short name is github by git remote -v
    2. Check config file in .git folder, make sure fetch = +refs/heads/*:refs/remotes/github/*

    If there still has error, you can clone the remote repo in a different folder, it’s the simplest way.