How to use GitHub for Mac with local Git repo

Kevin McCarpenter picture Kevin McCarpenter · Apr 17, 2012 · Viewed 21.2k times · Source

I'm trying to use a local Git repository (i.e. not hosted on GitHub at all), and I'm having troubles with GitHub for Mac.

It shows my outgoing changes, but then I appear to have to Push to the server, and there appears to be no way to perform a "Sync" without publishing to GitHub (which we don't want to do).

I haven't found any documentation regarding this, or users experiencing similar issues.

Any suggestions?

Answer

learnvst picture learnvst · Apr 17, 2012

The application is a free tool to encourage you to use GitHub, and works best with GitHub, but it can also work with private repositories now as detailed in this excerpt from http://mac.github.com/help

Multiple Git remotes & non-GitHub remotes GitHub for Mac does not support multiple Git remotes. We will only work with the origin remote. If you wish to push & pull to other remotes, we suggest that you use the command line client.

GitHub for Mac is optimized to work with GitHub remotes — but if you wish to use a non-GitHub remote, it will work just fine. Set the remote manually in the settings tab and everything else should work as expected.

I have tested the latest [Version 1.2.6 (010d408)] software with some of my private non-github remotes and it seems to work ok with some fiddling. In theory, you should just be able to drag and drop an existing repository into the new repository pane. If the existing repository on your local machine has been set up to work with your remote from the command line, then it should work just fine in the GitHub software....

However, I ran into a few hiccups along the way. For example, the GitHub for Mac software refused to acknowledge one of my repositories. I would continuously drag and drop it into the Mac software and it would refuse to show up in the repository list. Sometimes, a random repository would pop up instead from my GitHub account! Some of my other private repos worked just fine, and I could circumnavigate the strange bug by manually moving the .git directory to another folder and then dragging the local repo into the Mac software pane. It would then offer to set up a new repo in that folder. After this was done, I replaced the new .git directory with my old backup. Even with this little problem fixed, I still occasionally get random errors dialogue boxes that inform me that there has been a "Git Error" when browsing commits, although this information appears to be just an annoyance, as all my commit information is displayed correctly. I normally work from the command line and am pretty sure that there was no problem with the setup of my git repo.

In summary, GitHub form Mac is awesome for Gitub based repos, but still not perfect for your own repos on different remotes. There are, however, other free tools such as gity and gitx that work on mac and allow you to use a repo hosted anywhere. I have not tried Tower, but it looks pretty awesome.