Tyler DeWitt
Tyler DeWitt

Reputation: 23576

Find which repository I cloned

I've got a bare git repo on my test and production web servers. I cloned one of the two to my dev machine.

How can I figure out which one I cloned? That is, if I do a git push, which repo will I be affecting?

Thanks

Upvotes: 2

Views: 662

Answers (2)

Paul Beckingham
Paul Beckingham

Reputation: 14915

Specifically:

git remote show origin

but Daniel's answer yields more info.

Upvotes: 1

Daniel Pittman
Daniel Pittman

Reputation: 17222

git remote -v

That will print the full list of remotes for the current repository, plus the URL they pull and push to/from.

By default git requires you to be explicit about what remote you are using, but you can configure it to default to origin, which is standardly the place it was cloned from. (...but you don't have to call it that, and you can change that later.)

Upvotes: 1

Related Questions