# Fix git not updating remote from remote on fetch

You have cloned a repo maybe using shallow clone with `git clone --depth <depth> <repo>` implies `--single-branch`, 
But strangely when you are trying to fetch from remote, it's not working. 
To fix a local repo that's not fetching try:
or
```bash
git config remote.upstream.fetch "+refs/heads/*:refs/remotes/upstream/*"
git config --get remote.upstream.fetch
git fetch   
```      

To prevent this from happening in the future, As noted in the man page [git-clone(1)](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt), so we'd better do it with `git clone --depth <depth> --no-single-branch <repo>`. 

Reference: [Stackoverflow](https://stackoverflow.com/questions/11623862/fetch-in-git-doesnt-get-all-branches)
