git查看分支从哪里拉取
时间: 2023-10-29 22:08:24 浏览: 40
可以使用以下命令查看分支从哪里拉取:
```
git remote show <remote-name>
```
其中,`<remote-name>` 是指远程仓库的名称,一般默认为 `origin`。
执行该命令后,会显示远程仓库的信息,包括该仓库的 URL,以及每个分支最后一次从哪个分支拉取的。
例如:
```
$ git remote show origin
* remote origin
Fetch URL: https://github.com/user/repo.git
Push URL: https://github.com/user/repo.git
HEAD branch: master
Remote branches:
branch1 tracked
branch2 tracked
branch3 tracked
...
Local branches configured for 'git pull':
branch1 merges with remote branch1
branch2 merges with remote branch2
...
Local refs configured for 'git push':
branch1 pushes to branch1 (up to date)
branch2 pushes to branch2 (up to date)
...
```
在上面的输出中,可以看到 `origin` 远程仓库的 URL,以及每个分支最后一次从哪个分支拉取的。