Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - Browse remote repository

Tags:

git

I have a small problem at work.

We commit all the different projects to different remote repositories and sometimes people get confused by the names they create at 4 in the morning high on caffeine.

So my question is:

Is there a way to browse remote repositories to list all the branches?

Any help is greatly appreciated!

like image 770
RobinNilsson Avatar asked Oct 05 '22 00:10

RobinNilsson


2 Answers

To list only remote branches, first fetch (to ensure you have a local reference to them all), then list them:

git fetch
git branch -r

You may wish to, after fetching, do a git remote prune <remotename> (where <remotename> is the name of your remote—usually origin) to remove obsolete local references to remote branches that have been deleted.

The only way to directly “browse” a remote repository is to log into the server it resides on and do so (or setup gitweb or similar). Git is centered around the idea that your local copy has everything the remote does.

like image 195
Andrew Marshall Avatar answered Oct 11 '22 14:10

Andrew Marshall


git branch -a will list all branches, local and remote tracking.

like image 33
hd1 Avatar answered Oct 11 '22 12:10

hd1