简体   繁体   中英

how to git pull/fetch local repo from remote where cloned with --share --bare

I have a local repo cloned using

git clone --share --bare git@remote:foo.git /tmp/share.git

so now I can develop/push/pull from local clone at /tmp/share.git

However, how do I pull or fetch from remote:foo.git at /tmp/share.git

The --bare option means that you are only creating a git repositiory without a working directory, ie without any of your project files checked out on your disk. You can not directly work on this repository, it can only be used as a remote repository.

Now, I don't really understand what you are trying to do. If you want to work locally, then just use a basic clone:

git clone --share --bare git@remote:foo.git /tmp/share.git

As far as I understand, you are maybe trying to create a proxy to push / pull from a local tmp directory? It's useless. Remember that Git is a decentralized VCS, so except for push and pull operations, everything happens locally.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM