3

I've created a remote git repository on my local computer inside Google Drive folder

git init --bare project.git

and added the remote path as follows

git remote add origin '~/Google Drive/git/project.git'

When I commit via Xcode, it rightly shows the push option check box with correct branch (master in this case). I marked it checked and then press 'Commit and Push' and apparently it does so but actually not pushing to remote repository. When I push from 'Source Control -> Push', it shows successful message but my remote repository doesn't get updated.

When I run the push command from terminal then it does update the remote repository successfully.

git push origin master

How to fix so that Xcode (7.1.1) can push successfully?

Edited: A side note, this has troubled me a lot by the time I realized this. As initially, I think it was working via Xcode (maybe some prior version to 7) as well.

Edited: @VonC here is how I know how git push is working. The modified date gets changed for some objects in finder.

enter image description here

Edited: As per instruction by @VonC, now the push is working from Xcode when project.git is moved at different location out of 'Google Drive' folder. But, I want it to work with 'Google Drive' folder.

Edited: I further moved the project.git to a folder with name including space and again xcode is not pushing but terminal is still pushing.

zeeawan
  • 6,667
  • 2
  • 50
  • 56

2 Answers2

2

Xcode 7.1 doesn't push to remote repo path with a space but Terminal does provided that the path is enclosed in quotes. Hope Apple would fix it for new releases.

I've got my issue fixed by renaming the 'Goolge Drive' to 'GoogleDrive' and adjusted the remote path accordingly. Google Drive App prompted for missing folder and I pointed it to the renamed one.

zeeawan
  • 6,667
  • 2
  • 50
  • 56
0

my remote repository doesn't get updated.

Try simply to clone that repo repo elsewhere to see if you get back the content you just pushed:

git clone ~/Google Drive/git/project.git /somewhere/else

Don't forget that a bare repo has no working tree, so after a push, you don't see any new file.

Note: if a remote repo path with a space is problematic to XCode, a possible workaround would be to push to a path without path:

  • either one which is a symlink to Google Drive
  • or a path which is rsync'ed after to Google Drive
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I've cloned at different location but still the same issue with cloned copy. Git Push is working via Terminal but not via Xcode. – zeeawan Dec 12 '15 at 11:28
  • @zeeawan how do you that a push is working or not? do you do a `git log` in the bare repo? – VonC Dec 12 '15 at 11:31
  • @zeeawan OK. Just double check with a `git log` in `~/Google Drive/git/project.git`, to see that indeed the push did not take place. – VonC Dec 12 '15 at 11:43
  • git log shows only one update in last hour though I've tried a couple via xcode and one via terminal. – zeeawan Dec 12 '15 at 11:53
  • @zeeawan may be do a `git log --all` to be sure (http://stackoverflow.com/q/6214711/6309) – VonC Dec 12 '15 at 11:54
  • Yes, I've made sure that push is only working via terminal and not via xcode for even cloned copy. – zeeawan Dec 12 '15 at 12:13
  • 1
    @zeeawan can you try with a bare repo created on disk (instead of on Dropbox), to see if XCode successfully pushes to *that* bare repo? – VonC Dec 12 '15 at 12:14
  • I've moved the project.git to a different location and set the remote url accordingly. And yes, now xcode is pushing successfully to this new location other than Google Drive folder. – zeeawan Dec 12 '15 at 13:16