Derek Ekins
Derek Ekins

Reputation: 11391

Fetch references from remote git repo

I want to get the refs for a remote git repo (I am not interested in the code).

I am connecting over ssh. What commands would I need to execute to just download the refs information?

Upvotes: 0

Views: 76

Answers (3)

Ben
Ben

Reputation: 1367

You probably want to run some version of ls-remote

By default it only shows you the branches:

git ls-remote ssh://user@server/path/to/repo.git

use -t to show the tags:

git ls-remote -t ssh://user@server/path/to/repo.git

add -h to show the branches also:

git ls-remote -t -h ssh://user@server/path/to/repo.git

Upvotes: 2

axiac
axiac

Reputation: 72177

I guess git ls-remote is the Git command you are looking for.

Upvotes: 0

phd
phd

Reputation: 94397

git fetch origin branch

fetches updates from origin for a single branch.

git remote update origin

fetches updates from origin for all branches.

Upvotes: -1

Related Questions