Say you
git remote add origin [email protected]:myRepo.git
And then .. you know .. you forget what exactly origin
is mapped to :(
How can you find out?
You can view that origin with the command git remote -v, which will list the URL of the remote repo.
In Git, "origin" is a shorthand name for the remote repository that a project was originally cloned from. More precisely, it is used instead of that original repository's URL - and thereby makes referencing much easier. Note that origin is by no means a "magical" name, but just a standard convention.
Simply put: origin is just a name (the default name) for a remote (just meaning not your local) git repository.
git remote -v
will list them. The source for this information can be seen by inspecting .git/config
:
cat .git/config
The config
file in the .git
directory at the base of your repository contains all the configuration in a plain-text format.
You'll see something like this:
[remote "origin"] url = [email protected]:myRepo.git fetch = +refs/heads/*:refs/remotes/origin/*
The url
line (in git config parlance, the value of remote.origin.url
) contains the remote URL.
The other way to find out is by executing git config remote.origin.url
:
$ git config remote.origin.url [email protected]:myRepo.git $
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With