Srishti Gupta
Srishti Gupta

Reputation: 1273

Git Commands - Local Repository vs. Remote Repository

What are the different commands that can be used with only remote Git repository but cannot be used on local Git repository and vice-versa?

Upvotes: 1

Views: 187

Answers (1)

VonC
VonC

Reputation: 1323383

Most Git commands (almost all of them actually) are made to be used with local repositories only, to minimize latencies.

Some of them work with remote repositories as well as local ones:

git clone
git pull
git push
git fetch
git ls-remote
git remote prune/update 

I don't have on the top of my head a git command which would work exclusively with a remote one, if by remote you mean "outside of your local computer".
Each of the aforementioned command works with a "remote" repository which can be right there, on your hard drive.
Arguably, the git remote-helpers are used to communicate with repositories generally hosted outside your local computer though.

Upvotes: 3

Related Questions