25

说你

git remote add origin git@git.assembla.com:myRepo.git

然后..你知道..你忘记了到底origin映射到什么:(

你怎么知道?

4

3 回答 3

44
git remote -v

将列出它们。通过检查可以看到此信息的来源.git/config

cat .git/config

存储库基础目录中的config文件包含纯文本格式的所有配置。.git

你会看到这样的东西:

[remote "origin"]
        url = git@git.assembla.com:myRepo.git
        fetch = +refs/heads/*:refs/remotes/origin/*

url行(在 git config 用语中,的值remote.origin.url)包含远程 URL。

另一种查找方法是执行git config remote.origin.url

$ git config remote.origin.url
git@git.assembla.com:myRepo.git
$ 
于 2012-06-19T01:01:45.157 回答
8
git remote -v

will give a list of all remote along with their corresponding URLs. You can find out even more information about the remote by doing

git remote show origin

Read more in the man page for git-remote.

于 2012-06-19T01:02:40.057 回答
6

You can run the following command:

git remote -v

to get a list of all remotes with their URL.

From the man-page:

OPTIONS
-v, --verbose
Be a little more verbose and show remote url after name. NOTE: This must be placed between remote and subcommand.

COMMANDS
With no arguments, shows a list of existing remotes. Several subcommands are available to perform operations on the remotes.

于 2012-06-19T01:02:27.863 回答