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
I assume GitHub for Mac or Tower for Mac would handle this like any other remote.