Search code examples
gitgit-remote

git remote has no output


I recently got a new Apple silicon Mac, where previously I've used Linux/Ubuntu. I'm using zsh in the default terminal app. I noticed that using

git remote
git remote -v

have no output even though I'm in a git repository that has a remote. For example

git push

works and

cat .git/config

gives

...
[branch "master"]
        remote = <URL OF REMOTE>
        merge = refs/heads/master
...

When I use my Linux machines, I get the expected result which is:

$ git remote
origin

and

$ git remote -v
origin <URL OF REMOTE> (fetch)
origin <URL OF REMOTE> (push)

so I'm wondering why git remote isn't working.


Solution

  • I would have to suggest that on this repo on this machine you do not in fact have a remote. Here's an idea: try adding one! Say

    git remote add origin <URL OF REMOTE>
    

    and see if your life gets better.