I have a list of directories where I want to run git pull
Some of these may be empty.
When I run git pull
on it, I get this error:
Your configuration specifies to merge with the ref 'master'
from the remote, but no such ref was fetched.
and an exit code of 1
I have my script to exit if any command fails.
Is it possible to detect if it failed due to this error? Or any other way to pull which doesn't error out on empty repositories?
Edit: .git/config
git:(master) cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = <git repo url>
[branch "master"]
remote = origin
merge = refs/heads/master