Which Git commands cannot be executed locally?
When I talk to colleagues about Git, I tell them, that there are only three Git commands that cannot be executed without going to a remote repository once a local repo is initialized (assuming that origin
is not on the local machine, of course):
git fetch
git pull
git push
Just to make su开发者_如何学编程re that I didn't miss something: are there any other commands that need a connection to a remote repository?
git clone
git ls-remote
git remote prune
git remote show
git remote update
git submodule update
git request-pull
... ...
Also many git svn
subcommands require an external Subversion repository.
There are several "plumbing" commands that require an external repository, but in the context of introducing colleagues to git, it's probably only worth listing the "porcelain" commands like those above.
git remote update
and git remote show ${REMOTE}
will also need to connect to the remote.
git request-pull
also would like to connect to a (potentially remote) repository.
精彩评论