1

This is for a network drive. My colleague and I are in the same directory and are both using Git Bash.

On the Windows computer (this is the correct one):

$ git status
On branch master
nothing to commit, working tree clean

On the Mac (this is incorrect):

On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

       modified:   .gitignore

...[some more files]...

no changes added to commit (use "git add" and/or "git commit -a")

I first suspected this was due to the Mac not being able to see the hidden .git folder at first, but unhiding this didn't do anything.

If this is helpful, I have this network drive under the letter name S:/ in Windows, but in the Mac, this directory is being accessed through Volumes/. I don't know enough about Macs to know if this matters.

Any ideas about where to begin would be excellent.

Clarinetist
  • 1,097
  • 18
  • 46
  • I'm not sure i understand what you are trying to do. why are you using a network drive? are you trying to use it as a remote? – Robbie Apr 26 '18 at 19:42
  • @Robbie I don't have any choice over what to use. The fact of the matter is that the Git repository is in a network drive. – Clarinetist Apr 26 '18 at 19:46
  • if the git repository on the network drive is the remote, then you shouldn't be editing your files directly on the network drive, you should be cloning from the network drive to the local filesystem on the mac/windows machines, and then committing/pushing your changes to the network drive – Robbie Apr 26 '18 at 19:50
  • @Robbie Thanks, I'll keep this in mind next time. I haven't really dug much into the collaborative parts of Git yet (i.e., cloning) - most of my experience with it has been work I've done on my own. – Clarinetist Apr 26 '18 at 19:51
  • you may want to checkout this SO post - there is a good example of a network drive based workflow and setup: https://stackoverflow.com/a/15487443/459517 – Robbie Apr 26 '18 at 19:56
  • but if you do have the option to use a hosted system like Github (as @staypuftman suggested) - i'd do that – Robbie Apr 26 '18 at 19:58

1 Answers1

3

You're trying to use your share drive like a server, that's the problem. Windows and Macs have different rules around seeing hidden files that are probably getting lost in the Samba handshake. Push your repo up to a cloud service that hosts repositories, like Github, Bitbucket, etc.

serraosays
  • 7,163
  • 3
  • 35
  • 60
  • Thank you for the suggestion. Could you elaborate as to what could possibly be causing this? I'm not understanding what you're meaning by the "Samba handshake." – Clarinetist Apr 26 '18 at 19:38
  • Windows and Macs can't talk to each other directly. They need an intermediary and usually - but not always - your network drive will be a samba server (https://en.wikipedia.org/wiki/Samba_(software)). My best guess is the Mac can't see your `.gitignore` file but your Windows machine can. – serraosays Apr 26 '18 at 19:42
  • As in the OP (see the `git status` output for the Mac), the Mac does see the `.gitignore` file, but I'm going to mark this as best answer anyway, because at the very least, I have a solution to this. – Clarinetist Apr 26 '18 at 19:44
  • Yeah sorry, I mean't the mac could see the `.gitignore`. Really, give Github a shot for collaborative coding projects - it's awesome. – serraosays Apr 26 '18 at 19:48