It is absolutely possible – what you probably want to do is create a “bare” git repository in folder Y (
git init --bare)
and then add that file location as a remote:
git remote add Y file:///path/to/Y #example path: file:///media/sf_OneDrive/gitr
======= push and pull has different repo ==========
git remote set-url origin --push --add <a remote> git remote set-url origin --push --add <another remote>
========push to multiple repo======
The latest version of git (as of October 2012) allows you to do this from the command line:
git remote set-url origin --push --add user1@repo1 git remote set-url origin --push --add user2@repo2 git remote -v
It is also possible to push encrypted code to public repo, not tested.
CC-BY-NC 4.0 licensed free for non-commercial usage
Author: Qingfeng XIA
copyright (C) 2011-2020
please keep the original link in your reference.